akennedy4155 opened a new issue #20185:
URL: https://github.com/apache/airflow/issues/20185


   ### Apache Airflow version
   
   2.1.4
   
   ### What happened
   
   The upgrade check script does not warn for a DAG that uses deprecated 
parameters on deprecated operators.  Now that I'm checking this through 
further, the upgrade-check script doesn't even warn when the deprecated 
`bash_operator` is used.
   
   If this is expected, please let me know, but these DAGs will cause import 
errors when upgrading to Airflow 2.
   
   ### What you expected to happen
   
   I expect that the upgrade check script warns when the deprecated 
`bash_operator` is used in a DAG.  I would hope to see a recommendation to 
change this in the output of the script.  On top of that.  I would expect that 
if a deprecated param is used for this operator, then there is also a warning 
for that as well.
   
   ### How to reproduce
   
   DAG to reproduce in Airflow 1:
   
   ```
   from datetime import datetime, timedelta
   from airflow.decorators import dag, task
   from airflow.configuration import conf
   
   # Default settings applied to all tasks
   default_args = {
       'owner': 'airflow',
       'depends_on_past': False,
       'email_on_failure': False,
       'email_on_retry': False,
       'retries': 1,
       'retry_delay': timedelta(minutes=5)
   }
   
   
   # Using a DAG context manager, you don't have to specify the dag property of 
each task
   @dag(
       'extract_release_name_from_namespace_var',
       start_date=datetime(2021, 1, 1),
       max_active_runs=1,
       default_args=default_args,
       catchup=True,
   )
   def xcom_testing_dag():
       @task
       def extract_and_print():
           # namespace = conf.get("kubernetes", "namespace")
           namespace = "astronomer-release-name-1234"
           print("-".join(namespace.split("-")[1:]))
           print(namespace.replace("astronomer-", ""))
       extract_and_print()
   
   
   xcom_dag = xcom_testing_dag()
   
   ```
   
   DAG runs fine on Airflow 1, including bridge release, 1.10.15.
   
   After confirming, then the upgrade check script is run, which produces the 
following output:
   
   ```
   ====== STATUS ======
   
   Check for latest versions of apache-airflow and checkerSUCCESS
   Remove airflow.AirflowMacroPlugin classSUCCESS
   Ensure users are not using custom metaclasses in custom operatorsSUCCESS
   Chain between DAG and operator not allowed.SUCCESS
   Connection.conn_type is not nullableSUCCESS
   Custom Executors now require full pathSUCCESS
   Check versions of PostgreSQL, MySQL, and SQLite to ease upgrade to Airflow 
2.0SKIPPED
   Hooks that run DB functions must inherit from DBApiHookSUCCESS
   Fernet is enabled by defaultSUCCESS
   GCP service account key deprecationSUCCESS
   Unify hostname_callable option in core sectionSUCCESS
   Changes in import paths of hooks, operators, sensors and othersSUCCESS
   Legacy UI is deprecated by defaultSUCCESS
   Logging configuration has been moved to new sectionSUCCESS
   Removal of Mesos ExecutorSUCCESS
   No additional argument allowed in BaseOperator.SUCCESS
   Rename max_threads to parsing_processesSUCCESS
   Users must set a kubernetes.pod_template_file valueSKIPPED
   Ensure Users Properly Import conf from AirflowSUCCESS
   SendGrid email uses old airflow.contrib moduleSUCCESS
   Check Spark JDBC Operator default connection nameSUCCESS
   Changes in import path of remote task handlersSUCCESS
   Connection.conn_id is not uniqueSUCCESS
   Use CustomSQLAInterface instead of SQLAInterface for custom data 
models.SUCCESS
   Found 2 problems.
   
   = RECOMMENDATIONS ==
   
   Check versions of PostgreSQL, MySQL, and SQLite to ease upgrade to Airflow 
2.0
   
------------------------------------------------------------------------------
   Unable to parse DB version, skipped!
   
   Users must set a kubernetes.pod_template_file value
   ---------------------------------------------------
   Skipped because this rule applies only to environment using 
KubernetesExecutor.
   ```
   
   No warning given for the deprecated operator and param for that operator.
   
   Then, after upgrading to Airflow 2.1.4, the DAG is broken with an import 
error shown at the top of the UI:
   
   
![image](https://user-images.githubusercontent.com/12237683/145485442-0a1b5074-8131-458f-ac66-f69010d75318.png)
   
   
   ### Operating System
   
   macOS Big Sur 11.3.1
   
   ### Versions of Apache Airflow Providers
   
   n/a
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   Astro Dev used for testing.  Versions 1.10.15 for v1 and 2.1.4 for v2.
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to