Skip to content

Commit

Permalink
fix(presto): use correct timespec for presto (#20333)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohittt8 authored Jun 16, 2022
1 parent 998624b commit 41bbf62
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 41bbf62

Please sign in to comment.