mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[sql] Fixing datetime SQL literal (#8464)
This commit is contained in:
@@ -341,3 +341,16 @@ class PrestoTests(DbEngineSpecTestCase):
|
||||
)
|
||||
query_result = str(result.compile(compile_kwargs={"literal_binds": True}))
|
||||
self.assertEqual("SELECT \nWHERE ds = '01-01-19' AND hour = 1", query_result)
|
||||
|
||||
def test_convert_dttm(self):
|
||||
dttm = self.get_dttm()
|
||||
|
||||
self.assertEqual(
|
||||
PrestoEngineSpec.convert_dttm("DATE", dttm),
|
||||
"from_iso8601_date('2019-01-02')",
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
PrestoEngineSpec.convert_dttm("TIMESTAMP", dttm),
|
||||
"from_iso8601_timestamp('2019-01-02T03:04:05.678900')",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user