bito-code-review[bot] commented on code in PR #40274:
URL: https://github.com/apache/superset/pull/40274#discussion_r3270204141
##########
pytest.ini:
##########
@@ -18,5 +18,30 @@
testpaths =
tests
python_files = *_test.py test_*.py *_tests.py *viz/utils.py
-addopts = -p no:warnings
+# `-p no:warnings` temporarily disabled in favor of more finely tuned
`filterwarnings`.
+#addopts = -p no:warnings
asyncio_mode = auto
+
+# `ignore` virtually reproduces to `-p no:warnings`.
+# Always print RemovedIn20Warning when SQLALCHEMY_WARN_20=1.
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>misleading comment contradicts behavior</b></div>
<div id="fix">
The comment on line 26 states 'Always print RemovedIn20Warning when
SQLALCHEMY_WARN_20=1' but the current filter configuration will silently ignore
all such warnings instead.
</div>
</div>
<small><i>Code Review Run #6a1b1e</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
##########
pytest.ini:
##########
@@ -18,5 +18,30 @@
testpaths =
tests
python_files = *_test.py test_*.py *_tests.py *viz/utils.py
-addopts = -p no:warnings
+# `-p no:warnings` temporarily disabled in favor of more finely tuned
`filterwarnings`.
+#addopts = -p no:warnings
asyncio_mode = auto
+
+# `ignore` virtually reproduces to `-p no:warnings`.
+# Always print RemovedIn20Warning when SQLALCHEMY_WARN_20=1.
+# Additionally, raise errors for refactored RemovedIn20Warning cases to
prevent regression.
+filterwarnings =
+ ignore
+ always::sqlalchemy.exc.RemovedIn20Warning
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>filterwarnings order prevents always action</b></div>
<div id="fix">
The `ignore` filter on line 29 will catch all `RemovedIn20Warning` warnings
before the `always` filter on line 30 can act, making the latter completely
ineffective. This contradicts the comment on line 26 which promises to 'Always
print RemovedIn20Warning'. In pytest's filterwarnings, the first matching
filter wins.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
--- pytest.ini (lines 28-30) ---
28: filterwarnings =
29: - ignore
30: - always::sqlalchemy.exc.RemovedIn20Warning
30: + always::sqlalchemy.exc.RemovedIn20Warning
31: + ignore
```
</div>
</details>
</div>
<small><i>Code Review Run #6a1b1e</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]