betodealmeida commented on code in PR #41290:
URL: https://github.com/apache/superset/pull/41290#discussion_r3455569921
##########
superset/charts/data/dashboard_filter_context.py:
##########
@@ -332,6 +332,18 @@ def apply_dashboard_filter_context(
for key in EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS:
if key in extra_form_data:
extras[key] = extra_form_data[key]
+
+ # EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS is originally used with
form_data objects,
+ # not query_context objects. form_data objects expect time_grain_sqla
as a
+ # top-level key, but query_context objects expect it as an extra key.
+ if custom_time_grain := extra_form_data.get("time_grain_sqla"):
+ extras["time_grain_sqla"] = custom_time_grain
+ # Inject ``filter_timegrain`` into X-Axis column
+ for column in query.get("columns") or []:
+ if isinstance(column, dict) and column.get("columnType") ==
"BASE_AXIS":
+ column["timeGrain"] = custom_time_grain
+ break
Review Comment:
I think this makes sense, let's align backend/frontend here.
--
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]