mirror of https://github.com/apache/superset.git
fix: Presto column_type_mappings time and timestamp (#12861)
* Fix presto column_type_mappings time and timestamp * Added unit tests
This commit is contained in:
parent
783aae19c9
commit
51195af4fa
|
@ -353,8 +353,8 @@ class PrestoEngineSpec(BaseEngineSpec): # pylint: disable=too-many-public-metho
|
||||||
(re.compile(r"^varbinary.*", re.IGNORECASE), types.VARBINARY()),
|
(re.compile(r"^varbinary.*", re.IGNORECASE), types.VARBINARY()),
|
||||||
(re.compile(r"^json.*", re.IGNORECASE), types.JSON()),
|
(re.compile(r"^json.*", re.IGNORECASE), types.JSON()),
|
||||||
(re.compile(r"^date.*", re.IGNORECASE), types.DATE()),
|
(re.compile(r"^date.*", re.IGNORECASE), types.DATE()),
|
||||||
(re.compile(r"^time.*", re.IGNORECASE), types.Time()),
|
|
||||||
(re.compile(r"^timestamp.*", re.IGNORECASE), types.TIMESTAMP()),
|
(re.compile(r"^timestamp.*", re.IGNORECASE), types.TIMESTAMP()),
|
||||||
|
(re.compile(r"^time.*", re.IGNORECASE), types.Time()),
|
||||||
(re.compile(r"^interval.*", re.IGNORECASE), Interval()),
|
(re.compile(r"^interval.*", re.IGNORECASE), Interval()),
|
||||||
(re.compile(r"^array.*", re.IGNORECASE), Array()),
|
(re.compile(r"^array.*", re.IGNORECASE), Array()),
|
||||||
(re.compile(r"^map.*", re.IGNORECASE), Map()),
|
(re.compile(r"^map.*", re.IGNORECASE), Map()),
|
||||||
|
|
|
@ -554,6 +554,12 @@ class TestPrestoDbEngineSpec(TestDbEngineSpec):
|
||||||
sqla_type = PrestoEngineSpec.get_sqla_column_type("integer")
|
sqla_type = PrestoEngineSpec.get_sqla_column_type("integer")
|
||||||
assert isinstance(sqla_type, types.Integer)
|
assert isinstance(sqla_type, types.Integer)
|
||||||
|
|
||||||
|
sqla_type = PrestoEngineSpec.get_sqla_column_type("time")
|
||||||
|
assert isinstance(sqla_type, types.Time)
|
||||||
|
|
||||||
|
sqla_type = PrestoEngineSpec.get_sqla_column_type("timestamp")
|
||||||
|
assert isinstance(sqla_type, types.TIMESTAMP)
|
||||||
|
|
||||||
sqla_type = PrestoEngineSpec.get_sqla_column_type(None)
|
sqla_type = PrestoEngineSpec.get_sqla_column_type(None)
|
||||||
assert sqla_type is None
|
assert sqla_type is None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue