aniaan commented on a change in pull request #17048:
URL: https://github.com/apache/superset/pull/17048#discussion_r726254177



##########
File path: superset/db_engine_specs/elasticsearch.py
##########
@@ -59,10 +60,20 @@ def get_dbapi_exception_mapping(cls) -> 
Dict[Type[Exception], Type[Exception]]:
         }
 
     @classmethod
-    def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
-        if target_type.upper() == utils.TemporalType.DATETIME:
-            return f"""CAST('{dttm.isoformat(timespec="seconds")}' AS 
DATETIME)"""
-        return None
+    def convert_dttm(
+        cls, target_type: str, dttm: datetime, **kwargs: Any
+    ) -> Optional[str]:
+
+        if target_type.upper() != utils.TemporalType.DATETIME:
+            return None
+
+        es_version = kwargs.get("version")

Review comment:
       > Should this be documented somewhere? It might not be apparent to the 
user why the behavior differs by version.
   
   Added




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to