Vitor-Avila commented on code in PR #41131:
URL: https://github.com/apache/superset/pull/41131#discussion_r3425321598
##########
superset/charts/data/api.py:
##########
@@ -204,41 +201,13 @@ def get_data( # noqa: C901
except SupersetSecurityException:
return self.response_403()
- if dashboard_filter_context.extra_form_data:
- efd = dashboard_filter_context.extra_form_data
- extra_filters = efd.get("filters", [])
-
- for query in json_body.get("queries", []):
- if extra_filters:
- existing = query.get("filters") or []
- query["filters"] = existing + [
- {**f, "isExtra": True} for f in extra_filters
- ]
-
- extras = query.get("extras") or {}
- for key in EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS:
- if key in efd:
- extras[key] = efd[key]
- if extras:
- query["extras"] = extras
-
- for (
- src_key,
- target_key,
- ) in EXTRA_FORM_DATA_OVERRIDE_REGULAR_MAPPINGS.items():
- if src_key in efd:
- query[target_key] = efd[src_key]
-
- query["extra_form_data"] = efd
Review Comment:
The entire logic was just moved to a helper. The only real change is this
line. We were doing `query["extra_form_data"] = efd`, so `extra_form_data`
would have the filters that were already injected with `query["filters"] =
existing + [{**f, "isExtra": True} for f in extra_filters]`. In the new helper,
we're setting `query["extra_form_data"]` to not have the filters (since they
were already added to the queries).
--
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]