Vitor-Avila commented on code in PR #41131:
URL: https://github.com/apache/superset/pull/41131#discussion_r3425313960
##########
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
-
- # We need to apply the form data to the global context as jinja
- # templating pulls form data from the request globally, so this
- # fallback ensures it has the filters and extra_form_data
applied
- # when used in get_sqla_query which constructs the final query.
-
- # Jinja macros like metric() resolve dataset context from g.form_data
- # when not given an explicit dataset_id. For GET requests there is no
- # JSON body, so we must always expose the saved query context here.
Review Comment:
I thought these comment blocks were a bit redundant so kept only the top
part.
--
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]