mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix(elasticsearch): time_zone setting does not work for cast datetime expressions (#17048)
* fix(elasticsearch): cast does not take effect for time zone settings * test(elasticsearch): add test * fix(test): fix typo * docs(elasticsearch): add annotation * docs(elasticsearch): add time_zone desc * docs(elasticsearch): fix typo * refactor(db_engine): change convert_dttm signature * fix(test): fix test * fix(es): add try catch * fix(test): fix caplog * fix(test): fix typo
This commit is contained in:
@@ -521,7 +521,9 @@ def test__normalize_prequery_result_type(
|
||||
dimension: str,
|
||||
result: Any,
|
||||
) -> None:
|
||||
def _convert_dttm(target_type: str, dttm: datetime) -> Optional[str]:
|
||||
def _convert_dttm(
|
||||
target_type: str, dttm: datetime, db_extra: Optional[Dict[str, Any]] = None
|
||||
) -> Optional[str]:
|
||||
if target_type.upper() == TemporalType.TIMESTAMP:
|
||||
return f"""TIME_PARSE('{dttm.isoformat(timespec="seconds")}')"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user