bito-code-review[bot] commented on code in PR #39390:
URL: https://github.com/apache/superset/pull/39390#discussion_r3192117344
##########
tests/integration_tests/utils/encrypt_tests.py:
##########
@@ -89,6 +89,21 @@ def test_ensure_encrypted_field_factory_is_used(self):
" encrypted_field_factory"
)
+ def test_discover_encrypted_fields_finds_dbs_table(self):
+ """
+ Ensure discover_encrypted_fields finds the encrypted columns on the
+ dbs table (password, encrypted_extra, server_cert). This guards
+ against db.metadata diverging from db.Model.metadata.
+ """
+ migrator = SecretsMigrator("")
+ encrypted_fields = migrator.discover_encrypted_fields()
+ assert "dbs" in encrypted_fields, (
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Use of assert in production code</b></div>
<div id="fix">
Replace `assert` statement on line 100 with a proper test assertion method
or conditional check, as `assert` can be disabled with Python's `-O` flag.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
migrator = SecretsMigrator("")
encrypted_fields = migrator.discover_encrypted_fields()
self.assertIn("dbs", encrypted_fields,
````
</div>
</details>
</div>
<div><details><summary><b>Review Rule</b></summary><div>Bito created the
rule <strong><code>Avoid Native Assert Statements in Unit Tests</code></strong>
for <strong>repo:</strong> <code>apache/superset</code>,
<strong>language:</strong> <code>Python</code>. Bito will avoid suggestions
that match this rule. You can manage review rules <a
href=https://alpha.bito.ai/home/ai-agents/review-rules>here</a>.</div></details></div>
<small><i>Code Review Run #e93f2d</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]