mirror of
https://github.com/apache/superset.git
synced 2026-05-13 03:45:12 +00:00
fix(mysql): fallback to pymysql when MySQLdb is not installed in get_datatype() (#39729)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
54f1e32763
commit
c7c9a17d6b
@@ -402,7 +402,10 @@ class MySQLEngineSpec(BasicParametersMixin, BaseEngineSpec):
|
||||
if not cls.type_code_map:
|
||||
# only import and store if needed at least once
|
||||
# pylint: disable=import-outside-toplevel
|
||||
import MySQLdb
|
||||
try:
|
||||
import MySQLdb
|
||||
except ImportError:
|
||||
import pymysql as MySQLdb # type: ignore[import-untyped] # noqa: N812
|
||||
|
||||
ft = MySQLdb.constants.FIELD_TYPE
|
||||
cls.type_code_map = {
|
||||
|
||||
Reference in New Issue
Block a user