Skip to content

Conversation

@ephraimbuddy
Copy link
Contributor

Running upgrade_check with this import in a dag:
from airflow.operators.slack_operator import SlackAPIPostOperator

Causes these warnings:
[1] Using airflow.operators.slack_operator.SlackAPIPostOperator should be replaced by airflow.providers.slack.operators.slack.SlackAPIPostOperator.
[2] Using airflow.operators.slack_operator.SlackAPIOperator should be replaced by airflow.providers.slack.operators.slack.SlackAPIOperator

Only 1 above is correct.
This PR fixes it by checking that both the old import part and class name exists in the dag before issuing warning

Related slack conversation: https://apache-airflow.slack.com/archives/CCPRP7943/p1615388292013900


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

Running upgrade_check with this import in a dag:
from airflow.operators.slack_operator import SlackAPIPostOperator

Causes these warnings:
[1] Using `airflow.operators.slack_operator.SlackAPIPostOperator` should be replaced by `airflow.providers.slack.operators.slack.SlackAPIPostOperator`.
[2] Using `airflow.operators.slack_operator.SlackAPIOperator` should be replaced by `airflow.providers.slack.operators.slack.SlackAPIOperator`

Only 1 above is correct.
This PR fixes it by checking that both the old import part and class name exists in the dag before issuing warning
@ephraimbuddy ephraimbuddy added the upgrade-check upgrade-check CLI label Mar 10, 2021
@ephraimbuddy ephraimbuddy requested review from eladkal and kaxil March 10, 2021 16:22
Copy link
Contributor

@eladkal eladkal left a comment

Choose a reason for hiding this comment

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

Verified on my DAGs. I don't see any further false messages.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Mar 10, 2021
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@kaxil kaxil merged commit 6edf6aa into apache:v1-10-stable Mar 10, 2021
@kaxil kaxil deleted the fix-wrong-warning-in-classname branch March 10, 2021 19:53
@kaxil kaxil added this to the Airflow Upgrade Check - 1.3.0 milestone Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full tests needed We need to run full set of tests for this PR to merge upgrade-check upgrade-check CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants