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 2022/05/10 17:18:06 UTC

[GitHub] [superset] eschutho commented on a diff in pull request #19812: WIP- create mixin for chart query

eschutho commented on code in PR #19812:
URL: https://github.com/apache/superset/pull/19812#discussion_r869497708


##########
superset/models/helpers.py:
##########
@@ -543,3 +544,38 @@ def clone_model(
     data.update(kwargs)
 
     return target.__class__(**data)
+
+
+class ExploreMixin:
+    """
+    Sets up data to allow an object to be used to power a chart
+    """
+
+    @property
+    def database(self):
+        raise NotImplementedError
+
+    @property
+    def schema(self):
+        raise NotImplementedError
+
+    # @property
+    # def type(self) -> str:
+    #     return f"{self.__class__.__name__.lower()}"
+
+    type = "query"

Review Comment:
   can we make this more specific like `model_type`?



##########
superset/models/helpers.py:
##########
@@ -543,3 +544,38 @@ def clone_model(
     data.update(kwargs)
 
     return target.__class__(**data)
+
+
+class ExploreMixin:
+    """
+    Sets up data to allow an object to be used to power a chart
+    """
+
+    @property
+    def database(self):
+        raise NotImplementedError
+
+    @property
+    def schema(self):
+        raise NotImplementedError
+
+    # @property
+    # def type(self) -> str:
+    #     return f"{self.__class__.__name__.lower()}"
+
+    type = "query"

Review Comment:
   can we make this more specific like `model_type`?



-- 
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: notifications-unsubscribe@superset.apache.org

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