diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx index bc95bc487ee3..c444e027d9b2 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx @@ -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), ), }, diff --git a/superset/db_engine_specs/snowflake.py b/superset/db_engine_specs/snowflake.py index 578ded965bed..cd083a76b215 100644 --- a/superset/db_engine_specs/snowflake.py +++ b/superset/db_engine_specs/snowflake.py @@ -162,7 +162,7 @@ def convert_dttm( 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 diff --git a/tests/unit_tests/db_engine_specs/test_snowflake.py b/tests/unit_tests/db_engine_specs/test_snowflake.py index 854d3f5f61c0..2f1171c33c3d 100644 --- a/tests/unit_tests/db_engine_specs/test_snowflake.py +++ b/tests/unit_tests/db_engine_specs/test_snowflake.py @@ -34,6 +34,7 @@ ("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: