mirror of https://github.com/apache/superset.git
fix(db_engine_specs): Update convert_dttm to work correctly with CrateDB (#27567)
This commit is contained in:
parent
e32b1c861f
commit
fcceaf081c
|
@ -59,7 +59,7 @@ class CrateEngineSpec(BaseEngineSpec):
|
|||
sqla_type = cls.get_sqla_column_type(target_type)
|
||||
|
||||
if isinstance(sqla_type, types.TIMESTAMP):
|
||||
return f"{dttm.timestamp() * 1000}"
|
||||
return f"CAST('{dttm.isoformat()}' AS TIMESTAMP)"
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -59,7 +59,7 @@ def test_alter_new_orm_column() -> None:
|
|||
@pytest.mark.parametrize(
|
||||
"target_type,expected_result",
|
||||
[
|
||||
("TimeStamp", "1546398245678.9"),
|
||||
("TimeStamp", "CAST('2019-01-02T03:04:05.678900' AS TIMESTAMP)"),
|
||||
("UnknownType", None),
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue