apache / apache/airflow

Variable entity: additional attribute to define its type

Open
#37,390 3 comments 0 reactions 0 assignees View on GitHub
area:core kind:feature
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 7h
Merged PRs (30d)
484

Description

### Description

With first Airflow based project initialization I use Connection and Variable entities. Some variables must be json type only. I just do json.dumps to the value now. It is assumed that it will be modified over the UI if needed. Good, but:

1. For that variables by the UI (and not only) we can set anything.
2. UI does not have highlighting/linter/validator since the application does not have information about the type.

Why we cannot just add optional type for Variable?

### Use case/motivation

1. Strict Variable type definition to handle its modification
2. User friendly Highlighting / linter by the type (json for example) in UI

### Related issues

[#12147](https://github.com/apache/airflow/issues/12147)

### Are you willing to submit a PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Variable entity and its UI editing flow, then review related issue #12147 for prior discussion. Done means an optional variable type can be defined, respected during modification, and used by the UI for type-appropriate highlighting, linting, or validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.