Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix(presto): use correct timespec for presto (apache#20333)
Browse files Browse the repository at this point in the history
(cherry picked from commit 41bbf62)
  • Loading branch information
mohittt8 authored and John Bodley committed Jun 16, 2022
1 parent ecb3db5 commit e51fe45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion superset/db_engine_specs/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def convert_dttm(
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
Expand Down
6 changes: 3 additions & 3 deletions tests/unit_tests/db_engine_specs/test_presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
(
"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'",
),
],
)
Expand Down

0 comments on commit e51fe45

Please sign in to comment.