bito-code-review[bot] commented on code in PR #44899:
URL: https://github.com/apache/superset/pull/44899#discussion_r4170953719
##########
tests/unit_tests/queries/query_object_test.py:
##########
@@ -90,6 +91,19 @@ def test_default_query_object_to_dict():
}
[email protected]("clause", ["where", "having"])
+def test_semantic_view_rejects_custom_sql_extras(clause: str) -> None:
+ """Unsupported SQL clauses fail without SQLA database state."""
+ view: SemanticView = SemanticView(name="Orders")
+ view.__dict__["implementation"] = MagicMock()
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Untyped mock, fragile stub</b></div>
<div id="fix">
`view.__dict__["implementation"] = MagicMock()` stubs the
`SemanticView.implementation` cached_property by writing the instance dict
directly. It works, but the mock is untyped contrary to the repo's mock-typing
rule, and the `__dict__` write silently depends on `cached_property` checking
the instance dict first. Prefer a typed mock installed via a small documented
helper.
</div>
</div>
<small><i>Code Review Run #8dca49</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]