mirror of https://github.com/apache/superset.git
fix: Athena timestamp literal format (#19970)
* Fix Athena timestamp literal format related: [#19969] * Update test_athena.py Update test * Update athena.py * Resolving CI/CD * lint Co-authored-by: Thinh Nguyen Duc <thinhnd.it@tripi.vn> Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
This commit is contained in:
parent
1c3c3ae2ea
commit
85315460cb
|
@ -69,7 +69,7 @@ class AthenaEngineSpec(BaseEngineSpec):
|
||||||
if tt == utils.TemporalType.DATE:
|
if tt == utils.TemporalType.DATE:
|
||||||
return f"DATE '{dttm.date().isoformat()}'"
|
return f"DATE '{dttm.date().isoformat()}'"
|
||||||
if tt == utils.TemporalType.TIMESTAMP:
|
if tt == utils.TemporalType.TIMESTAMP:
|
||||||
datetime_formatted = dttm.isoformat(timespec="microseconds")
|
datetime_formatted = dttm.isoformat(sep=" ", timespec="milliseconds")
|
||||||
return f"""TIMESTAMP '{datetime_formatted}'"""
|
return f"""TIMESTAMP '{datetime_formatted}'"""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ def test_convert_dttm(app_context: AppContext, dttm: datetime) -> None:
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
AthenaEngineSpec.convert_dttm("TIMESTAMP", dttm)
|
AthenaEngineSpec.convert_dttm("TIMESTAMP", dttm)
|
||||||
== "TIMESTAMP '2019-01-02T03:04:05.678900'"
|
== "TIMESTAMP '2019-01-02 03:04:05.678'"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue