Skip to content

Preserve custom operator defaults in mapped tasks - #72589

Merged
vatsrahul1001 merged 6 commits into
apache:mainfrom
eitan-shalev:fix/mapped-operator-defaults
Sep 9, 2026
Merged

vatsrahul1001 merged 6 commits into
apache:mainfrom
eitan-shalev:fix/mapped-operator-defaults

Conversation

@eitan-shalev

@eitan-shalev eitan-shalev commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

BaseOperator.partial() fills known BaseOperator arguments from framework defaults. If a custom operator overrides the signature default of one of those arguments, mapping currently materializes the framework default and then passes it into the operator during unmapping. That changes the behavior relative to direct task construction.

Resolve defaulted BaseOperator arguments from the concrete operator signature before creating partial_kwargs. Explicit .partial() values and DAG/task default args retain their existing precedence.

Adds a regression test using retry_policy, which is the newly exposed instance of this longstanding behavior.

Closes: #72588

Validation

  • Added a focused mapped/unmapped regression test.
  • Reproduced the behavior and verified the proposed resolution with Apache Airflow 3.3.1.
  • Full Task SDK CI is pending.

Was generative AI tooling used to co-author this PR?
  • Yes: Codex

Generated-by: Codex following the guidelines

@eladkal eladkal added this to the Airflow 3.3.2 milestone Sep 7, 2026
@vatsrahul1001
vatsrahul1001 merged commit c2c8dce into apache:main Sep 9, 2026
107 checks passed
@github-actions

github-actions Bot commented Sep 9, 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

@eitan-shalev
eitan-shalev deleted the fix/mapped-operator-defaults branch September 10, 2026 08:03
vatsrahul1001 added a commit that referenced this pull request Sep 10, 2026
#72828)

* Preserve custom operator defaults in mapped tasks

* Preserve mapping defaults for custom operators

* Apply suggestion from @uranusjr



---------
(cherry picked from commit c2c8dce)

Co-authored-by: Eitan Shalev <[email protected]>
Co-authored-by: Tzu-ping Chung <[email protected]>
Co-authored-by: Rahul Vats <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:task-sdk type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mapped custom operators lose overridden BaseOperator defaults during unmap

4 participants