This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 41bbf62e58 fix(presto): use correct timespec for presto (#20333)
41bbf62e58 is described below
commit 41bbf62e586933172bde4b4080a4f21fe1ccd290
Author: mohittt8 <[email protected]>
AuthorDate: Fri Jun 17 05:13:17 2022 +0530
fix(presto): use correct timespec for presto (#20333)
---
superset/db_engine_specs/presto.py | 2 +-
tests/unit_tests/db_engine_specs/test_presto.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/superset/db_engine_specs/presto.py
b/superset/db_engine_specs/presto.py
index 9a72b76081..d0621e288e 100644
--- a/superset/db_engine_specs/presto.py
+++ b/superset/db_engine_specs/presto.py
@@ -761,7 +761,7 @@ class PrestoEngineSpec(BaseEngineSpec): # pylint:
disable=too-many-public-metho
utils.TemporalType.TIMESTAMP,
utils.TemporalType.TIMESTAMP_WITH_TIME_ZONE,
):
- return f"""TIMESTAMP '{dttm.isoformat(timespec="microseconds",
sep=" ")}'"""
+ return f"""TIMESTAMP '{dttm.isoformat(timespec="milliseconds",
sep=" ")}'"""
return None
@classmethod
diff --git a/tests/unit_tests/db_engine_specs/test_presto.py
b/tests/unit_tests/db_engine_specs/test_presto.py
index 512d03096b..228427c9ca 100644
--- a/tests/unit_tests/db_engine_specs/test_presto.py
+++ b/tests/unit_tests/db_engine_specs/test_presto.py
@@ -30,17 +30,17 @@ from flask.ctx import AppContext
(
"TIMESTAMP",
datetime(2022, 1, 1, 1, 23, 45, 600000),
- "TIMESTAMP '2022-01-01 01:23:45.600000'",
+ "TIMESTAMP '2022-01-01 01:23:45.600'",
),
(
"TIMESTAMP WITH TIME ZONE",
datetime(2022, 1, 1, 1, 23, 45, 600000),
- "TIMESTAMP '2022-01-01 01:23:45.600000'",
+ "TIMESTAMP '2022-01-01 01:23:45.600'",
),
(
"TIMESTAMP WITH TIME ZONE",
datetime(2022, 1, 1, 1, 23, 45, 600000, tzinfo=pytz.UTC),
- "TIMESTAMP '2022-01-01 01:23:45.600000+00:00'",
+ "TIMESTAMP '2022-01-01 01:23:45.600+00:00'",
),
],
)