codeant-ai-for-open-source[bot] commented on code in PR #43305:
URL: https://github.com/apache/superset/pull/43305#discussion_r3806161916
##########
tests/unit_tests/commands/importers/v1/utils_test.py:
##########
@@ -138,3 +138,85 @@ def test_scanner_error_raises_validation_error(self) ->
None:
with pytest.raises(ValidationError):
load_yaml("test.yaml", 'key: "unterminated string')
+
+
+class TestLoadConfigs:
+ def _database_schemas(self) -> dict[str, object]:
+ from marshmallow import fields, Schema
+
+ class DatabaseSchema(Schema):
+ uuid = fields.UUID(required=True)
+ database_name = fields.String(required=True)
+ sqlalchemy_uri = fields.String(required=True)
+ password = fields.String(required=False, allow_none=True)
+
+ return {"databases/": DatabaseSchema()}
Review Comment:
**Suggestion:** The regression tests use a locally simplified schema instead
of `ImportV1DatabaseSchema`, omit the production-required `version` field and
SSH-tunnel validators, and only assert that some filename-keyed exception
exists. Consequently, these tests can pass even if production schema behavior
or missing `ssh_tunnel` handling regresses; use the production schema and
assert the expected `uuid`/`ssh_tunnel` field errors. [incomplete
implementation]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Production schema regressions can pass unit tests.
- โ ๏ธ Missing `ssh_tunnel` handling remains untested.
- โ ๏ธ Incorrect field diagnostics could reach import endpoints.
```
</details>
[](https://github.com/CodeAnt-AI/skills/blob/main/skills/codeant-resolve-pr-comments/SKILL.md)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/commands/importers/v1/utils_test.py
**Line:** 144:153
**Comment:**
*Incomplete Implementation: The regression tests use a locally
simplified schema instead of `ImportV1DatabaseSchema`, omit the
production-required `version` field and SSH-tunnel validators, and only assert
that some filename-keyed exception exists. Consequently, these tests can pass
even if production schema behavior or missing `ssh_tunnel` handling regresses;
use the production schema and assert the expected `uuid`/`ssh_tunnel` field
errors.
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%2F43305&comment_hash=919ec68b113ab214ddede93ff6d65817d0be5c6809730bb86372c747093a718e&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43305&comment_hash=919ec68b113ab214ddede93ff6d65817d0be5c6809730bb86372c747093a718e&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]