Fix partition key display and input handling#69702
Merged
Merged
Conversation
Lee-W
requested review from
bbovenzi,
choo121600,
guan404ming,
pierrejeambrun,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
July 10, 2026 11:21
Lee-W
force-pushed
the
ui-partition-key-polish
branch
from
July 13, 2026 00:59
f745c87 to
2776b94
Compare
Lee-W
force-pushed
the
ui-partition-key-polish
branch
from
July 14, 2026 01:52
2776b94 to
4ef58f0
Compare
bbovenzi
reviewed
Jul 14, 2026
Lee-W
force-pushed
the
ui-partition-key-polish
branch
from
July 15, 2026 03:04
4ef58f0 to
09a6e23
Compare
bbovenzi
reviewed
Jul 15, 2026
Non-partitioned Dag runs showed a dangling "Partition key:" label, an empty partition key typed then cleared was sent to the trigger/materialize APIs and rejected with 400, the trigger form exposed the field even for non-partitioned Dags, the manual asset-event partition key used a JsonEditor for a plain string, and the runs table hid the partition_key column even when its filter was shown for a partitioned Dag. Also unify the partition key label so cron/runtime-partitioned runs no longer say "Mapped Partition key".
The trigger form and manual/materialize asset-event flows each duplicated the same undefined/empty-string-to-null check before sending partition_key to the API, making the normalization easy to get subtly wrong in one call site while fixing it in another.
Collapse the redundant undefined/null comparison into a single loose-equality null check, matching the reviewer's simplification of the earlier partition key display fix.
The runs table hid the partition_key column by default and revealed it only for partitioned Dags by fetching Dag details and forcing a table remount once the answer arrived. That remount-on-load approach was fragile, and the show/hide behaviour is better solved by a reusable mechanism (one that could also drive e.g. hiding map_index for non-mapped tasks), so it is dropped here to be reworked separately.
Lee-W
force-pushed
the
ui-partition-key-polish
branch
from
July 16, 2026 07:48
09a6e23 to
af4cfa6
Compare
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
Member
Author
|
Thanks, Brent! |
Lee-W
added a commit
that referenced
this pull request
Jul 17, 2026
Lee-W
pushed a commit
that referenced
this pull request
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The partition key handling in the UI had a few rough edges:
Partition key:label with nothing after it.400.JsonEditorto enter the partition key, which is a plain string, not JSON.Mapped Partition Key. At the run level the value is the concrete key the run runs for, not a mapper-transformed key, so theMappedqualifier was misleading.What
Add a shared
toNullablePartitionKeyutil that normalizesundefinedand empty string tonull, and use it at every call site that sendspartition_key(trigger, manual asset event, materialize). This is what fixes the empty-key400.HeaderandAssetEventno longer render a partition-key line when the value is null/undefined.Label created runs as
Partition Key(wasMapped Partition Key).Mapped Partition Keyis intentionally kept where a partition mapper derives a downstream key from upstream asset key(s); it is not touched here.The trigger form only shows the partition key field for partitioned Dags, with an
Optional - only applies to partitioned Dagshelper text.The manual asset-event partition key uses a plain text
Inputinstead of theJsonEditor.Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.