Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

Trying to import BaseNotifier from the older path in core reported in

(link_name, task.get_extra_links(ti, link_name)) for link_name in task.extra_links
  File "/opt/airflow/airflow-core/src/airflow/models/mappedoperator.py", line 177, in get_extra_links
    return link.get_link(self.unmap(None), ti_key=ti.key)
  File "/opt/airflow/task-sdk/src/airflow/sdk/definitions/mappedoperator.py", line 772, in unmap
    SerializedBaseOperator.populate_operator(op, self.operator_class)
  File "/opt/airflow/airflow-core/src/airflow/serialization/serialized_objects.py", line 1348, in populate_operator
    and operator.__module__ == encoded_op["_task_module"]
KeyError: '_task_module'

We should maintain backcompat to allow seamless migration for end users.

Also interestingly the shorthand from airflow.sdk import BaseNotifier didn;t work. Fixed it in the PR too


^ 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.

Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving since it is a simple change

@kaxil kaxil added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label May 8, 2025
@amoghrajesh amoghrajesh requested a review from potiuk May 9, 2025 06:56
@potiuk potiuk added this to the Airflow 3.0.2 milestone May 9, 2025
@potiuk potiuk merged commit bf99522 into apache:main May 9, 2025
70 checks passed
github-actions bot pushed a commit that referenced this pull request May 9, 2025
* Adding backcompat shim for BaseNotifier

* Adding deprecation warning too

* using deprecation properly
(cherry picked from commit bf99522)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
@github-actions
Copy link

github-actions bot commented May 9, 2025

Backport successfully created: v3-0-test

Status Branch Result
v3-0-test PR Link

github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 9, 2025
* Adding backcompat shim for BaseNotifier

* Adding deprecation warning too

* using deprecation properly
(cherry picked from commit bf99522)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
potiuk pushed a commit that referenced this pull request May 9, 2025
* Adding backcompat shim for BaseNotifier

* Adding deprecation warning too

* using deprecation properly
(cherry picked from commit bf99522)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
kaxil pushed a commit that referenced this pull request Jun 3, 2025
* Adding backcompat shim for BaseNotifier

* Adding deprecation warning too

* using deprecation properly
(cherry picked from commit bf99522)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:task-sdk backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants