-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Fix type errors in operator link calls#54321
Conversation
Adds type: ignore comments to resolve mypy errors when calling BaseOperatorLink.get_link() with core operator types instead of the expected SDK BaseOperator type.
The BaseOperatorLink.get_link() method in the task SDK expects a BaseOperator parameter, but in the the references where we call it, we're passing:
- SerializedBaseOperator
- MappedOperator
For now, added type: ignore[arg-type] comments with TODO references to GH-52141, which tracks the broader issue of SDK/core type separation.
related #54295
Fixes CI errors:
airflow-core/src/airflow/serialization/serialized_objects.py:1300: error: Argument 1 to "get_link" of "BaseOperatorLink" has incompatible type "SerializedBaseOperator"; expected "BaseOperator"
[arg-type]
return link.get_link(self.unmap(None), ti_key=ti.key)
^~~~~~~~~~~~~~~~
airflow-core/src/airflow/models/mappedoperator.py:168: error: Argument 1 to "get_link" of "BaseOperatorLink" has incompatible type "MappedOperator"; expected "BaseOperator" [arg-type]
return link.get_link(self, ti_key=ti.key)
^~~~
Found 2 errors in 2 files (checked 982 source files)
Example: https://github.com/apache/airflow/actions/runs/16862119240/job/47764118285
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.