mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
feat: add generic type to column payload (#14547)
* feat: add generic type to column payload * feat: add generic type to column payload * xit flaky test
This commit is contained in:
@@ -22,7 +22,7 @@ from sqlalchemy.dialects.mysql import DATE, NVARCHAR, TEXT, VARCHAR
|
||||
from superset.db_engine_specs.mysql import MySQLEngineSpec
|
||||
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
|
||||
from superset.utils.core import GenericDataType
|
||||
from tests.db_engine_specs.base_tests import TestDbEngineSpec
|
||||
from tests.db_engine_specs.base_tests import assert_generic_types, TestDbEngineSpec
|
||||
|
||||
|
||||
class TestMySQLEngineSpecsDbEngineSpec(TestDbEngineSpec):
|
||||
@@ -65,7 +65,7 @@ class TestMySQLEngineSpecsDbEngineSpec(TestDbEngineSpec):
|
||||
)
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
def test_is_db_column_type_match(self):
|
||||
def test_generic_type(self):
|
||||
type_expectations = (
|
||||
# Numeric
|
||||
("TINYINT", GenericDataType.NUMERIC),
|
||||
@@ -89,10 +89,7 @@ class TestMySQLEngineSpecsDbEngineSpec(TestDbEngineSpec):
|
||||
("TIMESTAMP", GenericDataType.TEMPORAL),
|
||||
("TIME", GenericDataType.TEMPORAL),
|
||||
)
|
||||
|
||||
for type_str, col_type in type_expectations:
|
||||
column_spec = MySQLEngineSpec.get_column_spec(type_str)
|
||||
assert column_spec.generic_type == col_type
|
||||
assert_generic_types(MySQLEngineSpec, type_expectations)
|
||||
|
||||
def test_extract_error_message(self):
|
||||
from MySQLdb._exceptions import OperationalError
|
||||
|
||||
Reference in New Issue
Block a user