fix(sqla): replace custom dttm type with literal_column (#19917)

This commit is contained in:
Ville Brofeldt
2022-05-03 07:19:36 +03:00
committed by GitHub
parent 1ebdaac487
commit 99f1f9ec61
14 changed files with 63 additions and 137 deletions

View File

@@ -26,21 +26,21 @@ from flask.ctx import AppContext
"target_type,dttm,result",
[
("VARCHAR", datetime(2022, 1, 1), None),
("DATE", datetime(2022, 1, 1), "from_iso8601_date('2022-01-01')"),
("DATE", datetime(2022, 1, 1), "DATE '2022-01-01'"),
(
"TIMESTAMP",
datetime(2022, 1, 1, 1, 23, 45, 600000),
"from_iso8601_timestamp('2022-01-01T01:23:45.600000')",
"TIMESTAMP '2022-01-01T01:23:45.600000'",
),
(
"TIMESTAMP WITH TIME ZONE",
datetime(2022, 1, 1, 1, 23, 45, 600000),
"from_iso8601_timestamp('2022-01-01T01:23:45.600000')",
"TIMESTAMP '2022-01-01T01:23:45.600000'",
),
(
"TIMESTAMP WITH TIME ZONE",
datetime(2022, 1, 1, 1, 23, 45, 600000, tzinfo=pytz.UTC),
"from_iso8601_timestamp('2022-01-01T01:23:45.600000+00:00')",
"TIMESTAMP '2022-01-01T01:23:45.600000+00:00'",
),
],
)