codeant-ai-for-open-source[bot] commented on code in PR #40397:
URL: https://github.com/apache/superset/pull/40397#discussion_r3476453767
##########
tests/unit_tests/mcp_service/chart/tool/test_list_charts.py:
##########
@@ -184,6 +184,29 @@ def test_filter_validation(self):
with pytest.raises(ValueError, match="Field required"):
ChartFilter(col="slice_name") # Missing opr and value
+ def test_dashboards_filter_accepted(self):
+ """`dashboards` is a valid filter column for finding charts on a
dashboard."""
+ # The filter is accepted at schema-validation time
+ f = ChartFilter(col="dashboards", opr="eq", value=42)
+ assert f.col == "dashboards"
+ assert f.opr.value == "eq"
+ assert f.value == 42
+
+ # And composes into a request like any other filter
+ request = ListChartsRequest(filters=[f])
+ assert request.filters[0].col == "dashboards"
+
+ def test_invalid_filter_column_rejected(self):
Review Comment:
**Suggestion:** Add full type hints to this newly added test method,
including an explicit return type, to comply with the typing requirement for
new Python code. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is another newly added Python test method without type hints on `self`
or an explicit return type.
Since the surrounding code is being changed, the custom rule applies and the
omission is a verified violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c1aa04effed9451ba560268a05269c6b&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=c1aa04effed9451ba560268a05269c6b&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/mcp_service/chart/tool/test_list_charts.py
**Line:** 199:199
**Comment:**
*Custom Rule: Add full type hints to this newly added test method,
including an explicit return type, to comply with the typing requirement for
new Python code.
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%2F40397&comment_hash=b23f94b5667736a477861763627c7a6d7fd5fa6856b2bf0025f02b9990905bc8&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40397&comment_hash=b23f94b5667736a477861763627c7a6d7fd5fa6856b2bf0025f02b9990905bc8&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]