Managed Airflow supports Python 3.
To see the major.minor.patch versions of Python 3 used in a
specific Managed Airflow image, see
Managed Airflow version list.
After an environment is created, you cannot switch an existing environment to a different minor Python version.
Python 2 support in Managed Airflow (Legacy Gen 1)
Support for Python 2 was deprecated in Managed Airflow version 1.19.0:
Starting from version 1.19.0, it is not possible to create new environments with Python 2, or upgrade existing environments with Python 2 to 1.19.0 and later versions of Cloud Composer.
Starting from version 1.19.6, it is no longer possible to use any operators that call Python 2. In particular,
PythonVirtualenvOperatorcan no longer create virtual environments with Python 2.Existing environments with Python 2 are not impacted by this change. It is possible to upgrade such environments to Cloud Composer version 1.18.12 and earlier through gcloud CLI, API, and Terraform.
New Airflow operators, sensors, and hooks are only developed for Python 3, which may cause connectivity options to be outdated for Python 2 environments. As such, we highly recommend migrating your DAGs to a Python 3 environment, and creating all new environments with Python 3.