kaxil opened a new pull request, #62746:
URL: https://github.com/apache/airflow/pull/62746

   Move `KeywordParameters` class and `determine_kwargs()` from 
`airflow.utils.operator_helpers` to the Task SDK's `decorator.py`, next to 
`DecoratedOperator` which owns `python_callable` and `op_args`. This follows 
the precedent of `context_merge` which already moved to the SDK.
   
   **Why the standalone function via compat, not `self.determine_kwargs()`:**
   Providers are released independently from airflow-core/task-sdk. A newer 
provider calling `self.determine_kwargs(context)` against an older Task SDK 
(whose `DecoratedOperator` lacks the method) would fail with `AttributeError`. 
Using the standalone function through `common.compat.sdk` avoids this — the 
compat layer falls back to `airflow.utils.operator_helpers` where the original 
implementation lives on older Airflow versions. The instance method on 
`DecoratedOperator` is still available for internal SDK use.
   
   **Backwards compatibility:**
   - `airflow.utils.operator_helpers` uses `add_deprecated_classes` to 
re-export both symbols with a deprecation warning pointing to 
`airflow.sdk.bases.decorator`
   - Non-decorated callers (http operator/sensor, python sensor, 
`make_kwargs_callable`) continue working through the re-export
   - Provider `pyproject.toml` files marked with `# use next version` for the 
common-compat dependency
   
   **Files changed:**
   
   | File | Change |
   |------|--------|
   | `task-sdk/.../decorator.py` | Add `KeywordParameters`, 
`determine_kwargs()` function, and `determine_kwargs()` instance method on 
`DecoratedOperator` |
   | `airflow-core/.../operator_helpers.py` | Replace implementations with 
`add_deprecated_classes` re-exports |
   | `providers/common/compat/.../sdk.py` | Add both symbols to compat layer 
with Airflow 2 fallbacks |
   | 6 decorated operators | Import `determine_kwargs` from `common.compat.sdk` 
instead of `operator_helpers` |
   | `PythonOperator` | Import `KeywordParameters` from `common.compat.sdk` |
   | 4 provider `pyproject.toml` | Add `# use next version` on common-compat 
dependency |
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.6)
   
   Generated-by: Claude Code (Opus 4.6) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to