Skip to content

Fix all deprecations for SQLAlchemy 2.0 #28723

@potiuk

Description

@potiuk

Body

Airflow is currently not compatible with SQLAlchemy 2.0 which is about to be released. We need to make a deliberate effort
to support it.

Here are some info to aid in this effort:

  • Description of all removed featuers in SQLAlchemy 2.0: https://sqlalche.me/e/b8d9

  • The way to see all the deprecations in latest version of SQLAlchemy 1.4 is to set environment variable SQLALCHEMY_WARN_20=1

  • How to start it:

    • add SQLALCHEMY_WARN_20=1 to ci.yml at top level
    • look through warnings.txt in tests to investigate the warnings (there will also be errors in the provider imports)
    • when all of them are fixed - remove <2.0 limitation in sqlalchemy in setup.cfg
    • make sure CI is green

Local setup in PyCharm

If you use PyCharm for run tests, you might want to setup SQLALCHEMY_WARN_20=1 for all pytest runs by default

  1. Go to Run -> Edit Configurations... -> click on Edit configuration templates...
    image
  2. In open window select Python Tests -> pytest and put SQLALCHEMY_WARN_20=1 into the environment variable section
    image
  3. Click Apply, Click OK
  4. Thats it, every new pytest run configuration will have this option by default

Known non-compatible with SA 20

Reported in core

Reported in providers

Reported in tests

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions