mirror of https://github.com/apache/superset.git
[hotfix] fix support for presto DATE and TIMESTAMP type
This commit is contained in:
parent
7325a4fb4b
commit
d6bc354ff3
|
@ -174,8 +174,11 @@ class PrestoEngineSpec(BaseEngineSpec):
|
|||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type, dttm):
|
||||
if target_type.upper() in ('DATE', 'DATETIME'):
|
||||
return "from_iso8601_date('{}')".format(dttm.isoformat())
|
||||
tt = target_type.upper()
|
||||
if tt == 'DATE':
|
||||
return "from_iso8601_date('{}')".format(dttm.isoformat()[:10])
|
||||
if tt == 'TIMESTAMP':
|
||||
return "from_iso8601_timestamp('{}')".format(dttm.isoformat())
|
||||
return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue