Troubleshooting Python or Airflow compatibility issues

You can learn more about how to identify the compatibility issues related to Python or Airflow versions during CDE upgrade and troubleshoot them.

Python upgrade from version 3.8 to version 3.11

Tools for porting Python from version 3.8 to version 3.11

This list contains automated tools that allow you to check the Python source code and modernize it to the latest version if necessary:
  • Python development mode: It can be enabled using the -X dev command line option or by setting the PYTHONDEVMODE environment variable to 1.
  • DeprecationWarnings: To check for deprecation warnings in your code, see DeprecationWarnings.
  • refurb: A tool for modernizing Python codebases. For more information, see refurb. For example,
    refurb --enable-all --python-version 3.8 dag_file.py
    
  • pyupgrade: A tool to automatically upgrade syntax for newer versions of Python. For more information, see pyupgrade. For example,
    # create a temporary git repository for the DAG files and run pyupgrade on them
    # NOTE: pyupgrade will rewrite the files automatically
    pyupgrade --py311-plus *.py 
    
    # check the modifications done by pyupgrade before updating the DAG files in CDE
    

Airflow upgrade from version 2.7.3 to version 2.9.3

  • Significant changes in Airflow version 2.8.0:
    • Raw HTML code in DAG docs and DAG params descriptions are disabled by default (#35460)
    • Account for change in UTC offset when calculating next schedule (#35887)
    • For the complete list of changes, see Airflow 2.8.0 documentation.
  • Significant changes in Airflow version 2.8.1:
    • Target version for core dependency pendulum package set to 3 (#36281)
    • Airflow packaging specification follows modern Python packaging standards (#36537)
    • Graphviz dependency is now an optional one, not required one (#36647)
    • Do not let EventsTimetable schedule past events if catchup=False (#36134)
    • For the complete list of changes, see Airflow 2.8.1 documentation.
  • Significant changes in Airflow version 2.8.2:
    • The allowed_deserialization_classes flag now follows a glob pattern (#36147)
    • The audit_logs permissions have been updated for heightened security (#37501)
    • AirflowTimeoutError is no longer except by default through Exception (#35653)
    • Revoking audit_log permission from all users except admin (#37501)
    • For the complete list of changes, see Airflow 2.8.2 documentation.
  • Significant changes in Airflow version 2.8.3:
  • Significant changes in Airflow version 2.8.4:
  • Significant changes in Airflow version 2.9.0:
    • Listener API methods are considered stable and can be used for production system (They were experimental features in older Airflow versions) (#36376)
    • Dataset URIs are now validated on input (#37005)
    • Add REST API actions to Audit Log events (#37734)
    • Prevent large string objects from being stored in the Rendered Template Fields (#38094)
    • The xcom change allows the storage of larger Xcom values in Airflow metadata 2^32 instead of 2^16 bytes. (#38401)
    • Stronger validation for key parameter defaults in taskflow context variables (#38015)
    • Deprecate smtp configs in airflow settings / local_settings (#37711)
    • For the complete list of changes, see Airflow 2.9.0 documentation.
  • Significant changes in Airflow version 2.9.1:
  • Significant changes in Airflow version 2.9.2:
  • Significant changes in Airflow version 2.9.3: