codeant-ai-for-open-source[bot] commented on code in PR #41960:
URL: https://github.com/apache/superset/pull/41960#discussion_r3564771885
##########
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:
**Suggestion:** Add an explicit type annotation for this local filter
payload variable to satisfy the requirement for annotating relevant new
variables. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The new local variable is a plain dictionary literal with no type
annotation, and the rule explicitly requires type hints on relevant variables
that can be annotated. This is a real instance of the stated violation.
</details>
<details>
<summary><b>Rule source ๐ </b></summary>
.cursor/rules/dev-standard.mdc (line 28)
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=871162817335444998a6703febdf2113&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=871162817335444998a6703febdf2113&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/common/test_query_actions_currency.py
**Line:** 315:315
**Comment:**
*Custom Rule: Add an explicit type annotation for this local filter
payload variable to satisfy the requirement for annotating relevant new
variables.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41960&comment_hash=7b7f612ef3c82c9e3ed880f51dc20c317277cbe924f976a32bbde3103667024b&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41960&comment_hash=7b7f612ef3c82c9e3ed880f51dc20c317277cbe924f976a32bbde3103667024b&reaction=dislike'>๐</a>
--
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]