fix: Convert TIMESTAMP_* to TIMESTAMP in Snowflake (#22872)
This commit is contained in:
parent
6998f65e1d
commit
3fd4718ecb
|
|
@ -334,7 +334,7 @@ class AnnotationLayer extends React.PureComponent {
|
|||
...x,
|
||||
data: {
|
||||
...x.data,
|
||||
groupby: x.data.groupby.map(column =>
|
||||
groupby: x.data.groupby?.map(column =>
|
||||
getColumnLabel(column),
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class SnowflakeEngineSpec(PostgresBaseEngineSpec):
|
|||
return f"TO_DATE('{dttm.date().isoformat()}')"
|
||||
if tt == utils.TemporalType.DATETIME:
|
||||
return f"""CAST('{dttm.isoformat(timespec="microseconds")}' AS DATETIME)"""
|
||||
if tt == utils.TemporalType.TIMESTAMP:
|
||||
if utils.TemporalType.TIMESTAMP in tt:
|
||||
return f"""TO_TIMESTAMP('{dttm.isoformat(timespec="microseconds")}')"""
|
||||
return None
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ from tests.unit_tests.fixtures.common import dttm
|
|||
("DATE", "TO_DATE('2019-01-02')"),
|
||||
("DATETIME", "CAST('2019-01-02T03:04:05.678900' AS DATETIME)"),
|
||||
("TIMESTAMP", "TO_TIMESTAMP('2019-01-02T03:04:05.678900')"),
|
||||
("TIMESTAMP_NTZ", "TO_TIMESTAMP('2019-01-02T03:04:05.678900')"),
|
||||
],
|
||||
)
|
||||
def test_convert_dttm(actual: str, expected: str, dttm: datetime) -> None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue