You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "liang-wenjie (via GitHub)" <gi...@apache.org> on 2026/08/31 03:45:19 UTC

[I] MySQL is omitted from available databases under SQLAlchemy 2 [superset]

liang-wenjie opened a new issue, #43699:
URL: https://github.com/apache/superset/issues/43699

   ### Bug description
   
   On `master`, native SQLAlchemy dialect discovery still calls the SQLAlchemy 1.4 `dialect.dbapi()` API. SQLAlchemy 2 native dialects expose `import_dbapi()` instead. The resulting `AttributeError` is caught by the broad exception handler, so the installed driver is silently omitted from the available database types.
   
   This is reproducible with MySQL:
   
   1. Install the dependencies from `master` and install `mysqlclient`.
   2. Verify `import MySQLdb` succeeds.
   3. Open **Settings > Database Connections > + Database** or request `/api/v1/database/available/`.
   4. MySQL is missing from the available database list.
   
   The backend logs:
   
   ```text
   Unable to load dialect <class 'sqlalchemy.dialects.mysql.mysqldb.MySQLDialect_mysqldb'>: type object 'MySQLDialect_mysqldb' has no attribute 'dbapi'
   ```
   
   Expected behavior: SQLAlchemy 2 dialects should be loaded through `import_dbapi()`, and installed engines such as MySQL should appear in the database connection UI.
   
   ### Screenshots/recordings
   
   Not applicable. The failure is visible in the API response and backend log.
   
   ### Environment
   
   - Superset version: master / latest-dev (`f3985d88a1`)
   - Python version: 3.12
   - SQLAlchemy version: 2.0.52
   - mysqlclient version: 2.2.8
   - Node/browser: Not applicable
   
   ### Additional context
   
   `MySQLDialect_mysqldb` reports `hasattr(dialect, "dbapi") == False` and `hasattr(dialect, "import_dbapi") == True`. Falling back to `dbapi()` for older SQLAlchemy versions preserves backward compatibility.
   
   ### Checklist
   
   - [x] I searched Superset docs and Slack and didn't find a solution.
   - [x] I searched the GitHub issue tracker and didn't find a matching bug report.
   - [x] I checked Superset logs and included the relevant error above.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] MySQL is omitted from available databases under SQLAlchemy 2 [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi closed issue #43699: MySQL is omitted from available databases under SQLAlchemy 2
URL: https://github.com/apache/superset/issues/43699


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org