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/02/10 13:31:56 UTC

[GitHub] [superset] villebro commented on a change in pull request #12998: feat(explore): Execute predicate query string if set

villebro commented on a change in pull request #12998:
URL: https://github.com/apache/superset/pull/12998#discussion_r573727487



##########
File path: superset/viz.py
##########
@@ -177,6 +177,11 @@ def process_metrics(self) -> None:
         self.all_metrics = list(self.metric_dict.values())
         self.metric_labels = list(self.metric_dict.keys())
 
+    def construct_where(self, query_obj: QueryObjectDict, predicate_string: str) -> str:
+        if query_obj:
+            predicate_string = "{} AND {}".format(query_obj, predicate_string)

Review comment:
       We probably need to add parenthesis here, if either of these has an OR it will break.
   ```suggestion
               predicate_string = "({}) AND ({})".format(query_obj, predicate_string)
   ```




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