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/03/03 09:22:26 UTC

[GitHub] [superset] kgabryje commented on a change in pull request #18998: fix(plugin-chart-echarts): Apply temporary filters to Query B in explore

kgabryje commented on a change in pull request #18998:
URL: https://github.com/apache/superset/pull/18998#discussion_r818461871



##########
File path: superset/utils/core.py
##########
@@ -1097,11 +1107,9 @@ def merge_extra_form_data(form_data: Dict[str, Any]) -> None:
         {"isExtra": True, **fltr} for fltr in append_adhoc_filters  # type: ignore
     )
     if append_filters:
-        adhoc_filters.extend(
-            simple_filter_to_adhoc({"isExtra": True, **fltr})  # type: ignore
-            for fltr in append_filters
-            if fltr
-        )
+        for key, value in form_data.items():
+            if re.match("adhoc_filter.*", key):
+                append_filters_to_adhoc_filters(value, append_filters)

Review comment:
       The point of iterating through form_data keys and checking regex is to make it more generic and future proof - it should work with any control that's name is like `adhoc_filter.*`, so not only `adhoc_filter` and `adhoc_filter_b`

##########
File path: superset/utils/core.py
##########
@@ -1056,6 +1056,16 @@ def form_data_to_adhoc(form_data: Dict[str, Any], clause: str) -> AdhocFilterCla
     return result
 
 
+def append_filters_to_adhoc_filters(

Review comment:
       good point!




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