codeant-ai-for-open-source[bot] commented on code in PR #41492:
URL: https://github.com/apache/superset/pull/41492#discussion_r3624734893
##########
tests/unit_tests/db_engine_specs/test_base.py:
##########
@@ -1383,3 +1383,11 @@ def
test_base_spec_public_information_includes_supports_offset() -> None:
assert "supports_offset" in info
assert info["supports_offset"] is True
+
+
+def test_get_public_information_exposes_ansi_identifier_quote() -> None:
+ """The base spec advertises ANSI double quotes for identifier quoting."""
+ assert BaseEngineSpec.get_public_information()["identifier_quote"] == {
+ "start": '"',
+ "end": '"',
+ }
Review Comment:
**Suggestion:** This test references `BaseEngineSpec` without importing it
in the function (or otherwise showing a module-level import in this hunk),
which can raise a `NameError` at runtime. Add an explicit import in this test
(as done in the neighboring test) to keep it self-contained and reliable.
[possible bug]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Unit test `test_get_public_information_exposes_ansi_identifier_quote`
crashes.
- ❌ DB engine specs test module fails to execute fully.
- ⚠️ CI pipeline may fail due to broken unit tests.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open `tests/unit_tests/db_engine_specs/test_base.py` and note that
`test_get_public_information_exposes_ansi_identifier_quote()` at line 1388
uses
`BaseEngineSpec` without any import inside the function.
2. In the same file, observe
`test_base_spec_public_information_includes_supports_offset()` at lines
1375–1382, which
performs a function-local import: `from superset.db_engine_specs.base import
BaseEngineSpec`, indicating no global import is relied upon.
3. Run the test suite (e.g. `pytest
tests/unit_tests/db_engine_specs/test_base.py`); when
pytest executes
`test_get_public_information_exposes_ansi_identifier_quote()` (line 1388),
Python evaluates `BaseEngineSpec.get_public_information()` at line 1390.
4. Because `BaseEngineSpec` is not defined in the module scope and not
imported in this
function, Python raises a `NameError: name 'BaseEngineSpec' is not defined`,
causing the
test (and potentially the test run) to fail.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e5d45fb91ea7438688ff8af8fe1a6aee&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=e5d45fb91ea7438688ff8af8fe1a6aee&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/db_engine_specs/test_base.py
**Line:** 1388:1393
**Comment:**
*Possible Bug: This test references `BaseEngineSpec` without importing
it in the function (or otherwise showing a module-level import in this hunk),
which can raise a `NameError` at runtime. Add an explicit import in this test
(as done in the neighboring test) to keep it self-contained and reliable.
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%2F41492&comment_hash=49552f0f23b3cd47e7521d30da1fa331b602ca73378313675be9c78818c85585&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41492&comment_hash=49552f0f23b3cd47e7521d30da1fa331b602ca73378313675be9c78818c85585&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]