"docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'" #56279
-
Hello Everyone, I am trying to build a custom image for Airflow 3.1.0 on Fedora 42 with Python 3.13 and FAB 5 but I am getting
It looks like support for FAB 5 was added in #50960 Attached are my docker-compose.yaml, Dockerfile and requirements.txt |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The #50960 adds support for FAB 5 in fab provider. The fab provider (3.*) that is going to support FAB 5 is not yet released. If you look at fab apache-airflow-providers-fab==2.4.4 deps, it explicitly depends of lower version of flask appbuilder. The mere fact of merging support when no release has been done since does not make released versions of software to "work" - the software needs to be relased first. Just watch announcement at the devlist and issue opened when we ask people to test it and when RC candidate is released (should be soon) you should test it and report back if you find any issues - this way you will be able to help us testing it. Please test and report any issues in the appropriate "status of testing" issue. We are counting on your help and engagement there as apparently you are eager to test it. |
Beta Was this translation helpful? Give feedback.
-
The simplest and recommended solution: Airflow 3.1.x expects FAB 4.x, so in your requirements.txt or Dockerfile:
Or in requirements.txt:
Then rebuild your image:
This should remove the cannot import SQLA errors and allow the auth manager to initialize properly.
Using Python 3.13 is cutting edge; Airflow 3.1.x is mainly tested on Python 3.10/3.11. If you run into other dependency issues, consider using Python 3.11 in your custom image:
After downgrading FAB, ensure your airflow.cfg has a proper auth manager:
This tells Airflow to use FAB for authentication, which should now work correctly with FAB 4.x. Recommended Approach Pin FAB to 4.x Stick with Python 3.11 (to match tested Airflow 3.1.x images) Rebuild the Docker image Initialize the DB: airflow db init Start Airflow services: webserver, scheduler, etc. After this, your Airflow CLI, webserver, and auth manager should work without the SQLA import errors. |
Beta Was this translation helpful? Give feedback.
The #50960 adds support for FAB 5 in fab provider. The fab provider (3.*) that is going to support FAB 5 is not yet released. If you look at fab apache-airflow-providers-fab==2.4.4 deps, it explicitly depends of lower version of flask appbuilder. The mere fact of merging support when no release has been done since does not make released versions of software to "work" - the software needs to be relased first.
Just watch announcement at the devlist and issue opened when we ask people to test it and when RC candidate is released (should be soon) you should test it and report back if you find any issues - this way you will be able to help us testing it. Please test and report any issues in th…