You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/19 16:37:59 UTC

[GitHub] [superset] dpgaspar commented on a change in pull request #12602: feat(db engines): add support for Opendistro Elasticsearch (AWS ES)

dpgaspar commented on a change in pull request #12602:
URL: https://github.com/apache/superset/pull/12602#discussion_r560317164



##########
File path: superset/db_engine_specs/elasticsearch.py
##########
@@ -46,3 +46,18 @@ 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
+
+
+class OpenDistro(ElasticSearchEngineSpec):
+
+    _time_grain_expressions = {
+        None: "{col}",
+    }
+
+    engine = "odelasticsearch"
+    engine_name = "ElasticSearch"
+
+    @classmethod
+    def make_label_compatible(cls, label: str) -> str:
+        new_label = super().make_label_compatible(label)
+        return new_label.replace(".", "_")

Review comment:
       thks! I guess we should rename `_mutate_label`  to `mutate_label`. This is still on it's infancy, still missing the dbapi PR merge and release and on this side the time grains are different for opendistro




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org