aminghadersohi commented on code in PR #41895:
URL: https://github.com/apache/superset/pull/41895#discussion_r3546821049


##########
superset/mcp_service/chart/chart_utils.py:
##########
@@ -911,6 +929,17 @@ def map_big_number_config(config: BigNumberChartConfig) -> 
Dict[str, Any]:
 
     _add_adhoc_filters(form_data, config.filters)
 
+    # Bind a TEMPORAL_RANGE adhoc filter so dashboard time-range filters have
+    # a column to apply to — mirrors the Explore UI's `BigNumberTotal` control
+    # panel, which exposes an `adhoc_filters` control even though there's no
+    # dedicated time-column control for the total variant. Falls back to the
+    # dataset's main_dttm_col when the caller didn't specify temporal_column.
+    # Guarded by is_column_truly_temporal (same check map_xy_config applies to
+    # its x-axis) so a non-temporal column never gets a TEMPORAL_RANGE filter.
+    temporal_column = config.temporal_column or 
_find_dataset_main_dttm_col(dataset_id)
+    if temporal_column and is_column_truly_temporal(temporal_column, 
dataset_id):
+        _ensure_temporal_adhoc_filter(form_data, temporal_column)

Review Comment:
   Fixed in d45c3eb069 — extracted `_resolve_big_number_temporal_column()`, 
which now fetches the dataset once and passes it into 
`is_column_truly_temporal(..., dataset=dataset)` for reuse instead of letting 
it re-query `DatasetDAO` for the same `dataset_id`. Added a regression test 
(`test_total_binds_dataset_main_dttm_col_for_dashboard_filters`) that asserts 
`DatasetDAO.find_by_id` is called exactly once.



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

Reply via email to