Copilot commented on code in PR #41131:
URL: https://github.com/apache/superset/pull/41131#discussion_r3424622728


##########
tests/unit_tests/charts/test_chart_data_api.py:
##########
@@ -73,6 +78,36 @@ def 
test_get_data_sets_g_form_data_without_dashboard_filter() -> None:
         assert g.form_data["queries"][0]["columns"] == ["col1"]
 
 
+def test_apply_dashboard_filter_context_does_not_duplicate_filters() -> None:
+    """
+    Regression test for the ``filters_dashboard_id`` parameter.
+
+    A dashboard's filters must be applied only through extra_form_data, the
+    single source of truth. Previously the same filter was also appended onto
+    query["filters"], so Jinja's filter_values() read each value twice and
+    produced SQL such as ``country in ('USA', 'USA')``.

Review Comment:
   The test docstring says dashboard filters should be applied only via 
`extra_form_data`, but this helper intentionally moves the filters into 
`query["filters"]` and removes them from `query["extra_form_data"]["filters"]` 
to avoid duplication. Updating the wording will make the regression test intent 
consistent with the actual behavior being asserted.



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