Upgrade to Superset Version 5 to 6 (Issues Faced) #36869
Replies: 2 comments 1 reply
-
|
The ImportError happens because Superset 6.x (with Flask-AppBuilder 5.x) no longer supports importing To fix your code, replace: from flask_appbuilder import SQLA
from sqlalchemy.orm import Session
class DashboardModelView1(BaseFormView):
session: Session = SQLA().sessionwith: from superset.extensions import db
from sqlalchemy.orm import Session
class DashboardModelView1(BaseFormView):
session: Session = db.sessionYou can then use Also, make sure your dependencies are compatible: Flask-AppBuilder 5.x requires Flask-SQLAlchemy 3.x. If you see related errors, update your dependency to No official migration guide exists for this change, but following the above pattern will resolve the ImportError and keep your session management compatible with Superset 6.x source. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@dosu or Anyone can answer I am facing another issue now
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We recently attempted to upgrade Apache Superset from version 5.x to 6.x.
Failed to import config for SUPERSET_CONFIG_PATH=/app/superset/superset_config.py
Traceback (most recent call last):
File "/app/superset/config.py", line 2299, in
spec.loader.exec_module(override_conf)
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/superset/superset_config.py", line 11, in
from flask_appbuilder import expose, IndexView,SQLA
ImportError: cannot import name 'SQLA' from 'flask_appbuilder' (/app/.venv/lib/python3.11/site-packages/flask_appbuilder/init.py)
How to solve this issue
Code snippet where we used it
ERROR faced
ImportError: cannot import name 'SQLA' from 'flask_appbuilder'
Beta Was this translation helpful? Give feedback.
All reactions