Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

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.

@potiuk potiuk merged commit 92856b1 into apache:main Aug 10, 2025
58 checks passed
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants