Skip to content

Replace models.BaseOperator to Task SDK one for Slack Provider #52347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vatsrahul1001
Copy link
Contributor

@vatsrahul1001 vatsrahul1001 commented Jun 27, 2025

The Providers should use the BaseOperator from Task SDK for Airflow 3.0+.

Related: #52292
^ 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.

Comment on lines +24 to +29
from airflow.providers.slack.version_compat import AIRFLOW_V_3_0_PLUS

if AIRFLOW_V_3_0_PLUS:
from airflow.sdk import BaseOperator
else:
from airflow.models import BaseOperator
Copy link
Contributor

Choose a reason for hiding this comment

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

The idea was that the (redundant) selection of where to get BaseOperator from is moved to version_compat.py such that the few lines of boilerplate are in one place. Then you can import directly from there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Mhm, you have unresolved but when I take a look it is still the same.

Target is that:

  1. version_compat import the BaseOperator with the version qualifier
  2. All operators in the provider import BaseOperator from version_compat (so do not need a version switch logic)

@vatsrahul1001 vatsrahul1001 requested a review from jscheffl June 30, 2025 10:45
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