Skip to content

Conversation

@Tomi-1997
Copy link
Contributor

Closes: #56427

Problem

When an Enum is used as a parameter in a DAG definition with no default value (or any Param, with no value or type), the field is rendered as a dictionary which might be confusing.

This is the trigger form's parameters with an enum with no default values, and an empty paramter.
before

Solution

  • Add 'null' to accepted enum types. (Complies with JSON schema validation)
  • Add a condition to return 'null' as the type, when a parameter's value is undefined

Now the enum is a drop down, and the empty parameter is a string field
after

This solves the enum issue, and addresses null values, yet I am unsure if this should be the intended behavior when handling missing default values. Browsing the docs, Param either has default value, or a type defined.
Anyway, I'm open to ideas!

* return 'null' when param.value is null, rather than typeof(null)

* added 'null' to list of enum types
@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Nov 25, 2025
@pierrejeambrun pierrejeambrun changed the title BUGFIX: trigger ui enum parameter field is a dictionary when param.value is null Fix rigger ui enum parameter field is a dictionary when param.value is null Dec 1, 2025
@pierrejeambrun pierrejeambrun added this to the Airflow 3.1.4 milestone Dec 1, 2025
@pierrejeambrun pierrejeambrun added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Dec 1, 2025
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks

@pierrejeambrun pierrejeambrun changed the title Fix rigger ui enum parameter field is a dictionary when param.value is null Fix trigger ui enum parameter field is a dictionary when param.value is null Dec 1, 2025
@pierrejeambrun pierrejeambrun merged commit 0adfc5b into apache:main Dec 1, 2025
62 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 1, 2025
…ue is null (#58682)

* return 'null' when param.value is null, rather than typeof(null)

* added 'null' to list of enum types
(cherry picked from commit 0adfc5b)

Co-authored-by: Tomi <74303735+Tomi-1997@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Dec 1, 2025
pierrejeambrun pushed a commit that referenced this pull request Dec 1, 2025
…ue is null (#58682) (#58899)

* return 'null' when param.value is null, rather than typeof(null)

* added 'null' to list of enum types
(cherry picked from commit 0adfc5b)

Co-authored-by: Tomi <74303735+Tomi-1997@users.noreply.github.com>
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

ephraimbuddy pushed a commit that referenced this pull request Dec 3, 2025
…ue is null (#58682) (#58899)

* return 'null' when param.value is null, rather than typeof(null)

* added 'null' to list of enum types
(cherry picked from commit 0adfc5b)

Co-authored-by: Tomi <74303735+Tomi-1997@users.noreply.github.com>
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Dec 3, 2025
…pache#58682)

* return 'null' when param.value is null, rather than typeof(null)

* added 'null' to list of enum types
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
…pache#58682)

* return 'null' when param.value is null, rather than typeof(null)

* added 'null' to list of enum types
itayweb pushed a commit to itayweb/airflow that referenced this pull request Dec 6, 2025
…pache#58682)

* return 'null' when param.value is null, rather than typeof(null)

* added 'null' to list of enum types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DAG Params Enum not works as expected

4 participants