Skip to content

Raise when attaching partition keys to asset alias events - #69312

Merged
Lee-W merged 1 commit into
apache:mainfrom
astronomer:reject-alias-partition-keys
Jul 7, 2026
Merged

Raise when attaching partition keys to asset alias events#69312
Lee-W merged 1 commit into
apache:mainfrom
astronomer:reject-alias-partition-keys

Conversation

@Lee-W

@Lee-W Lee-W commented Jul 3, 2026

Copy link
Copy Markdown
Member

Why

  • add_partitions() validated key emptiness/length but never checked whether the accessor was for an asset alias.
  • Calling it on an alias accessor silently dropped the partition key during serialization instead of attaching it anywhere — partition keys can only live on concrete asset events, not alias events.
  • A silent drop hides the mistake from the author; failing loudly surfaces it at the call site.

What

  • OutletEventAccessor.add_partitions() now raises TypeError when the accessor's key is an AssetAliasUniqueKey, before any key processing.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [Claude] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {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.

add_partitions() validated key emptiness/length but not whether the
accessor was for an asset alias, so calling it on an alias accessor
silently dropped the partition key during serialization instead of
attaching it to any asset event.
@Lee-W
Lee-W force-pushed the reject-alias-partition-keys branch from 39a94ee to 77ed97d Compare July 3, 2026 08:52
@Lee-W
Lee-W marked this pull request as ready for review July 3, 2026 08:54
@Lee-W
Lee-W requested review from amoghrajesh, ashb and kaxil as code owners July 3, 2026 08:54
@Lee-W Lee-W added this to the Airflow 3.3.1 milestone Jul 3, 2026
@Lee-W Lee-W self-assigned this Jul 3, 2026
@Lee-W Lee-W added the backport-to-v3-3-test Backport to v3-3-test label Jul 6, 2026
@Lee-W
Lee-W merged commit 045a71e into apache:main Jul 7, 2026
129 of 138 checks passed
@Lee-W
Lee-W deleted the reject-alias-partition-keys branch July 7, 2026 04:14
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Jul 7, 2026
…#69312)

(cherry picked from commit 045a71e)

Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Lee-W added a commit that referenced this pull request Jul 7, 2026
…#69312)

(cherry picked from commit 045a71e)

Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Lee-W added a commit that referenced this pull request Jul 8, 2026
vatsrahul1001 pushed a commit that referenced this pull request Jul 9, 2026
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants