rusackas commented on code in PR #41960:
URL: https://github.com/apache/superset/pull/41960#discussion_r3564824972
##########
tests/unit_tests/common/test_query_actions_currency.py:
##########
@@ -288,3 +290,60 @@ def
test_detect_currency_column_config_no_currency_column_returns_none(
)
assert result is None
+
+
+# Tests for drill-to-detail filter propagation (issue #28562)
+
+
+@patch("superset.common.query_actions._get_full")
+def test_get_drill_detail_preserves_applied_filters(
+ mock_get_full: MagicMock,
+) -> None:
+ """
+ Regression for #28562: 'Drill to Detail by' must carry a chart's applied
+ filters (e.g. the dashboard's native filters) into the drill-to-detail
+ samples query. The drill-detail action rewrites columns/metrics/orderby but
+ must leave ``QueryObject.filter`` untouched so the underlying rows stay
+ scoped to the dashboard's filter selections.
+
+ This exercises the backend drill-detail transformation directly and asserts
+ the incoming filters survive onto the query object that is ultimately
+ executed. A green run means the backend honors the filters (the reported
+ behavior is not reproduced in this code path); a red run means they are
+ dropped.
+ """
+ applied_filter = {"col": "region", "op": "==", "val": "USA"}
Review Comment:
Good call, typed the filter payload as QueryObjectFilterClause and
parametrized the capture return dict so mypy's happy now.
--
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]