mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +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:
@@ -15,7 +15,7 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from superset.db_engine_specs.base import BaseEngineSpec, LimitMethod
|
||||
from superset.utils import core as utils
|
||||
@@ -70,7 +70,9 @@ class FirebirdEngineSpec(BaseEngineSpec):
|
||||
return "DATEADD(second, {col}, CAST('00:00:00' AS TIMESTAMP))"
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
|
||||
def convert_dttm(
|
||||
cls, target_type: str, dttm: datetime, db_extra: Optional[Dict[str, Any]] = None
|
||||
) -> Optional[str]:
|
||||
tt = target_type.upper()
|
||||
if tt == utils.TemporalType.TIMESTAMP:
|
||||
dttm_formatted = dttm.isoformat(sep=" ")
|
||||
|
||||
Reference in New Issue
Block a user