Bug description
- Install latest Apache Airflow in Ubuntu machine - 22.04.3
- Initialize the superset db
- Login in the superset admin // admin
- Add the database connection, choose "Other"
- Enter valid Sqlalchemy URI, click on connection
Actual Error Message: ModuleNotFoundError: No module named 'sqlalchemy.sql._typing' Expected: It should allow us to connect.
Below are the packages installed: Package Version
alembic 1.13.3 amqp 5.2.0 apache-superset 4.0.2 apispec 6.7.0 apsw 3.46.1.0 async-timeout 4.0.3 attrs 24.2.0 babel 2.16.0 backoff 2.2.1 bcrypt 4.2.0 billiard 4.2.1 blinker 1.8.2 Bottleneck 1.4.2 Brotli 1.1.0 cachelib 0.9.0 cachetools 5.5.0 cattrs 24.1.2 celery 5.4.0 certifi 2024.8.30 cffi 1.17.1 charset-normalizer 3.4.0 click 8.1.7 click-didyoumean 0.3.1 click-option-group 0.5.6 click-plugins 1.1.1 click-repl 0.3.0 colorama 0.4.6 cron-descriptor 1.4.5 croniter 3.0.3 cryptography 42.0.8 Deprecated 1.2.14 deprecation 2.1.0 dnspython 2.7.0 email_validator 2.2.0 exceptiongroup 1.2.2 Flask 2.3.3 Flask-AppBuilder 4.5.2 Flask-Babel 2.0.0 Flask-Caching 2.3.0 Flask-Compress 1.17 Flask-JWT-Extended 4.6.0 Flask-Limiter 3.8.0 Flask-Login 0.6.3 Flask-Migrate 3.1.0 Flask-Session 0.8.0 Flask-SQLAlchemy 2.5.1 flask-talisman 1.1.0 Flask-WTF 1.2.2 func_timeout 4.3.5 geographiclib 2.0 geopy 2.4.1 google-auth 2.35.0 greenlet 3.1.1 gunicorn 21.2.0 h11 0.14.0 hashids 1.3.1 holidays 0.25 humanize 4.11.0 idna 3.10 importlib_metadata 8.5.0 importlib_resources 6.4.5 isodate 0.7.2 itsdangerous 2.2.0 Jinja2 3.1.4 jsonschema 4.23.0 jsonschema-specifications 2024.10.1 kombu 5.4.2 korean-lunar-calendar 0.3.1 limits 3.13.0 llvmlite 0.43.0 Mako 1.3.6 Markdown 3.7 markdown-it-py 3.0.0 MarkupSafe 3.0.2 marshmallow 3.23.0 marshmallow-sqlalchemy 0.28.2 mdurl 0.1.2 msgpack 1.0.8 msgspec 0.18.6 nh3 0.2.18 numba 0.60.0 numexpr 2.10.1 numpy 1.23.5 ordered-set 4.1.0 outcome 1.3.0.post0 packaging 24.1 pandas 2.0.3 paramiko 3.5.0 parsedatetime 2.6 pgsanity 0.2.9 pillow 11.0.0 pip 24.2 platformdirs 4.3.6 polyline 2.0.2 prison 0.2.1 prompt_toolkit 3.0.48 pyarrow 14.0.2 pyasn1 0.6.1 pyasn1_modules 0.4.1 pycparser 2.22 Pygments 2.18.0 PyJWT 2.9.0 PyNaCl 1.5.0 pyodbc 5.2.0 pyOpenSSL 24.2.1 pyparsing 3.2.0 pypyodbc 1.3.6 PySocks 1.7.1 python-dateutil 2.9.0.post0 python-dotenv 1.0.1 python-geohash 0.8.5 pytz 2024.2 PyYAML 6.0.2 redis 4.6.0 referencing 0.35.1 requests 2.32.3 requests-cache 1.2.1 rich 13.9.3 rpds-py 0.20.0 rsa 4.9 selenium 4.9.1 setuptools 75.2.0 shillelagh 1.3.0 shortid 0.1.2 simplejson 3.19.3 six 1.16.0 slack_sdk 3.33.2 sniffio 1.3.1 sortedcontainers 2.4.0 SQLAlchemy 1.4.54 sqlalchemy-ingres 0.0.8 SQLAlchemy-Utils 0.38.3 sqlglot 23.17.0 sqlparse 0.4.4 sshtunnel 0.4.0 tabulate 0.8.10 trio 0.27.0 trio-websocket 0.11.1 typing_extensions 4.12.2 tzdata 2024.2 url-normalize 1.4.3 urllib3 2.2.3 vine 5.1.0 wcwidth 0.2.13 Werkzeug 3.0.5 wrapt 1.16.0 wsproto 1.2.0 WTForms 3.2.1 WTForms-JSON 0.3.5 XlsxWriter 3.0.9 zipp 3.20.2 zstandard 0.23.0
Screenshots/recordings
Error:
Superset version
master / latest-dev
Python version
3.10
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hey @priyank-stack! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together! 😊
The error you're encountering, "ModuleNotFoundError: No module named 'sqlalchemy.sql._typing'," is likely related to a compatibility issue with the SQLAlchemy version you are using. Apache Superset 4.0.2 requires SQLAlchemy version 1.4.x, but it seems there might be a mismatch or an issue with the specific version you have installed.
Here are some steps you can take to resolve this issue:
-
Check SQLAlchemy Version: Ensure that you are using a compatible version of SQLAlchemy. Superset 4.0.2 requires SQLAlchemy version 1.4.x. You currently have version 1.4.54 installed, which should be compatible, but there might be a specific issue with this version.
-
Reinstall SQLAlchemy: Try reinstalling SQLAlchemy to ensure that all modules are correctly installed. You can do this by running:
bash pip uninstall sqlalchemy pip install sqlalchemy==1.4.54
-
Check for Conflicting Packages: Ensure that there are no other packages that might be conflicting with SQLAlchemy. Sometimes, other installed packages might cause conflicts.
-
Review Similar Issues: There have been similar issues reported, such as this closed issue where a user faced an AttributeError due to a version mismatch. The solution was to ensure the correct version of SQLAlchemy was installed [1].
If these steps do not resolve the issue, consider testing with a different version of SQLAlchemy within the 1.4.x range to see if the problem persists.
To continue talking to Dosu, mention @dosu.
Comment From: priyank-stack
Hey @priyank-stack! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together! 😊
The error you're encountering, "ModuleNotFoundError: No module named 'sqlalchemy.sql._typing'," is likely related to a compatibility issue with the SQLAlchemy version you are using. Apache Superset 4.0.2 requires SQLAlchemy version 1.4.x, but it seems there might be a mismatch or an issue with the specific version you have installed.
Here are some steps you can take to resolve this issue:
- Check SQLAlchemy Version: Ensure that you are using a compatible version of SQLAlchemy. Superset 4.0.2 requires SQLAlchemy version 1.4.x. You currently have version 1.4.54 installed, which should be compatible, but there might be a specific issue with this version.
- Reinstall SQLAlchemy: Try reinstalling SQLAlchemy to ensure that all modules are correctly installed. You can do this by running:
shell pip uninstall sqlalchemy pip install sqlalchemy==1.4.54
- Check for Conflicting Packages: Ensure that there are no other packages that might be conflicting with SQLAlchemy. Sometimes, other installed packages might cause conflicts.
- Review Similar Issues: There have been similar issues reported, such as this closed issue where a user faced an AttributeError due to a version mismatch. The solution was to ensure the correct version of SQLAlchemy was installed [1].
If these steps do not resolve the issue, consider testing with a different version of SQLAlchemy within the 1.4.x range to see if the problem persists.
To continue talking to Dosu, mention @dosu.
Reinstalled Superset with required instructions for SQLAlchemy: Below is the list Package Version
alembic 1.13.3 amqp 5.2.0 apache-superset 4.0.2 apispec 6.7.0 apsw 3.46.1.0 async-timeout 4.0.3 attrs 24.2.0 babel 2.16.0 backoff 2.2.1 bcrypt 4.2.0 billiard 4.2.1 blinker 1.8.2 Bottleneck 1.4.2 Brotli 1.1.0 cachelib 0.9.0 cachetools 5.5.0 cattrs 24.1.2 celery 5.4.0 certifi 2024.8.30 cffi 1.17.1 charset-normalizer 3.4.0 click 8.1.7 click-didyoumean 0.3.1 click-option-group 0.5.6 click-plugins 1.1.1 click-repl 0.3.0 colorama 0.4.6 cron-descriptor 1.4.5 croniter 3.0.4 cryptography 42.0.8 Deprecated 1.2.14 deprecation 2.1.0 dnspython 2.7.0 email_validator 2.2.0 exceptiongroup 1.2.2 Flask 2.3.3 Flask-AppBuilder 4.5.2 Flask-Babel 2.0.0 Flask-Caching 2.3.0 Flask-Compress 1.17 Flask-JWT-Extended 4.6.0 Flask-Limiter 3.8.0 Flask-Login 0.6.3 Flask-Migrate 3.1.0 Flask-Session 0.8.0 Flask-SQLAlchemy 2.5.1 flask-talisman 1.1.0 Flask-WTF 1.2.2 func_timeout 4.3.5 geographiclib 2.0 geopy 2.4.1 google-auth 2.35.0 greenlet 3.1.1 gunicorn 21.2.0 h11 0.14.0 hashids 1.3.1 holidays 0.25 humanize 4.11.0 idna 3.10 importlib_metadata 8.5.0 importlib_resources 6.4.5 isodate 0.7.2 itsdangerous 2.2.0 Jinja2 3.1.4 jsonschema 4.23.0 jsonschema-specifications 2024.10.1 kombu 5.4.2 korean-lunar-calendar 0.3.1 limits 3.13.0 llvmlite 0.43.0 Mako 1.3.6 Markdown 3.7 markdown-it-py 3.0.0 MarkupSafe 3.0.2 marshmallow 3.23.0 marshmallow-sqlalchemy 0.28.2 mdurl 0.1.2 msgpack 1.0.8 msgspec 0.18.6 nh3 0.2.18 numba 0.60.0 numexpr 2.10.1 numpy 1.23.5 ordered-set 4.1.0 outcome 1.3.0.post0 packaging 24.1 pandas 2.0.3 paramiko 3.5.0 parsedatetime 2.6 pgsanity 0.2.9 pillow 11.0.0 pip 24.3.1 platformdirs 4.3.6 polyline 2.0.2 prison 0.2.1 prompt_toolkit 3.0.48 pyarrow 14.0.2 pyasn1 0.6.1 pyasn1_modules 0.4.1 pycparser 2.22 Pygments 2.18.0 PyJWT 2.9.0 PyNaCl 1.5.0 pyodbc 5.2.0 pyOpenSSL 24.2.1 pyparsing 3.2.0 pypyodbc 1.3.6 PySocks 1.7.1 python-dateutil 2.9.0.post0 python-dotenv 1.0.1 python-geohash 0.8.5 pytz 2024.2 PyYAML 6.0.2 redis 4.6.0 referencing 0.35.1 requests 2.32.3 requests-cache 1.2.1 rich 13.9.3 rpds-py 0.20.0 rsa 4.9 selenium 4.9.1 setuptools 75.2.0 shillelagh 1.3.0 shortid 0.1.2 simplejson 3.19.3 six 1.16.0 slack_sdk 3.33.2 sniffio 1.3.1 sortedcontainers 2.4.0 *SQLAlchemy 1.4.54 sqlalchemy-ingres 0.0.6* SQLAlchemy-Utils 0.38.3 sqlglot 23.17.0 sqlparse 0.4.4 sshtunnel 0.4.0 tabulate 0.8.10 trio 0.27.0 trio-websocket 0.11.1 typing_extensions 4.12.2 tzdata 2024.2 url-normalize 1.4.3 urllib3 2.2.3 vine 5.1.0 wcwidth 0.2.13 Werkzeug 3.0.5 wrapt 1.16.0 wsproto 1.2.0 WTForms 3.2.1 WTForms-JSON 0.3.5 XlsxWriter 3.0.9 zipp 3.20.2 zstandard 0.23.0
Issue Message: ERROR: (builtins.NoneType) None [SQL: (pyodbc.Error) ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'Actian' : file not found (0) (SQLDriverConnect)") (Background on this error at: https://sqlalche.me/e/14/dbapi)] (Background on this error at: https://sqlalche.me/e/14/dbapi)
Comment From: clach04
As reported I think this is a manifestation of a bug in the (latest, as of 2024-10-28) Ingres Adapter (which supports SQLAlchemy 2.x and most of 1.x) - see https://github.com/ActianCorp/sqlalchemy-ingres/issues/68 this is NOT a problem with older versions of the Ingres Adapter which have full SQLAlchemy version 1.x support. Either use an older version of the Ingres SQLAlchemy Adapter that fully supports SQA version 1.0 .. or SuperSet needs to be updated to use SQLAlchemy version 2.
The trigger for this is the use of SQLAlchemy version 1.x, rather than the 2.x series. I'm note clear how much work it would take to update SuperSet (but I do not think just bumping the version dependency is enough).
Comment From: rusackas
This has been silent for quite a while. Is anyone here still facing this, particularly in 4.1.2 or 5.0.0rc2?
Comment From: clach04
@priyank-stack are you able retest with latest? CC @hab6
Comment From: rusackas
We haven't heard back in quite some time, so I'll assume all is well and close this out. Holler if it needs revisiting/reopening on 5.0/master