You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eitan-shalev (via GitHub)" <gi...@apache.org> on 2026/09/06 09:45:03 UTC
[PR] Preserve custom operator defaults in mapped tasks [airflow]
eitan-shalev opened a new pull request, #72589:
URL: https://github.com/apache/airflow/pull/72589
### 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?
- [X] Yes: Codex
Generated-by: Codex following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
---
๐ **Origin task in dev3:** [open in dev3](https://dev3.h0x91b.com/open.html?task=2e94cc8f-3e29-4dfb-87c6-e6ae10460cf5) ยท `dev3://task/2e94cc8f-3e29-4dfb-87c6-e6ae10460cf5`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Preserve custom operator defaults in mapped tasks [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #72589:
URL: https://github.com/apache/airflow/pull/72589#issuecomment-5606257241
### Backport successfully created: v3-3-test
Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
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](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>โ
</td>
<td>v3-3-test</td>
<td><a href="https://github.com/apache/airflow/pull/72828"><img src="https://img.shields.io/badge/PR-72828-blue" alt="PR Link"></a></td>
</tr>
</table>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Preserve custom operator defaults in mapped tasks [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #72589:
URL: https://github.com/apache/airflow/pull/72589#discussion_r3964650360
##########
task-sdk/src/airflow/sdk/bases/operator.py:
##########
@@ -270,6 +270,22 @@ def partial(**kwargs):
}
+def _get_operator_defaults(operator_class: type[BaseOperator]) -> dict[str, Any]:
+ """Get default values for an operator class's BaseOperator arguments."""
+ operator_defaults = OPERATOR_DEFAULTS.copy()
+ operator_classes = operator_class.mro()
+ for operator_base in reversed(operator_classes[: operator_classes.index(BaseOperator)]):
+ init = operator_base.__dict__.get("__init__")
+ if init is None:
Review Comment:
```suggestion
if (init := operator_base.__dict__.get("__init__")) is None:
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Preserve custom operator defaults in mapped tasks [airflow]
Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 merged PR #72589:
URL: https://github.com/apache/airflow/pull/72589
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org