SamWheating commented on a change in pull request #13622:
URL: https://github.com/apache/airflow/pull/13622#discussion_r557663565
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -113,7 +113,7 @@ def _check_file(file_path):
with open(file_path, "r") as file:
content = file.read()
for change in ImportChangesRule.ALL_CHANGES:
- if change.old_class in content:
+ if change.old_path in content:
Review comment:
The old version of this was subject to false positives, such as throwing
a warning on
`from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import
KubernetesPodOperator`
due to the match on `KubernetesPodOperator`
While this fixes that case, I think that this version will produce false
negatives, as we are now searching the file for the full import path
(`airflow.contrib.operators.kubernetes_pod_operator.KubernetesPodOperator`)
Which means that something like `from
airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator`
won't be caught as there isn't an exact match.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]