codeant-ai-for-open-source[bot] commented on code in PR #41533:
URL: https://github.com/apache/superset/pull/41533#discussion_r3493371991
##########
tests/unit_tests/result_set_test.py:
##########
@@ -522,6 +522,37 @@ def
test_clickhouse_json_column_in_pa_table_is_valid_json() -> None:
assert parsed1 == {"e": 5}
+def test_stringify_values_preserves_non_ascii_characters() -> None:
+ """
+ Non-ASCII text inside array/struct/JSON column values (e.g. the Cyrillic
and
+ CJK strings produced by ``array_agg``) must render verbatim in the result
+ grid, not as ``\\uXXXX`` escape sequences. Regression test for #19388 and
+ #22904, where such values were displayed as "unicode gibberish".
+ """
+ data = np.array(
+ [
+ ["Лонгсливы", "Свитшоты"],
+ {"city": "北京", "country": "中国"},
+ "你好,世界!",
+ ],
+ dtype=object,
+ )
Review Comment:
**Suggestion:** Add an explicit type annotation for `data` to satisfy the
type-hint requirement for relevant new variables. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The new test introduces a local `data` variable without a type annotation.
Since it is a newly added Python variable that can be annotated, this matches
the type-hint requirement for relevant variables.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c16144a2d9a14a62b031711962b67473&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=c16144a2d9a14a62b031711962b67473&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/result_set_test.py
**Line:** 532:539
**Comment:**
*Custom Rule: Add an explicit type annotation for `data` to satisfy the
type-hint requirement for relevant new variables.
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%2F41533&comment_hash=28e12edb12c2bd2430838e5274956b6b2b5ba9754aa69ad9631740ac2893e72c&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41533&comment_hash=28e12edb12c2bd2430838e5274956b6b2b5ba9754aa69ad9631740ac2893e72c&reaction=dislike'>👎</a>
##########
tests/unit_tests/result_set_test.py:
##########
@@ -522,6 +522,37 @@ def
test_clickhouse_json_column_in_pa_table_is_valid_json() -> None:
assert parsed1 == {"e": 5}
+def test_stringify_values_preserves_non_ascii_characters() -> None:
+ """
+ Non-ASCII text inside array/struct/JSON column values (e.g. the Cyrillic
and
+ CJK strings produced by ``array_agg``) must render verbatim in the result
+ grid, not as ``\\uXXXX`` escape sequences. Regression test for #19388 and
+ #22904, where such values were displayed as "unicode gibberish".
+ """
+ data = np.array(
+ [
+ ["Лонгсливы", "Свитшоты"],
+ {"city": "北京", "country": "中国"},
+ "你好,世界!",
+ ],
+ dtype=object,
+ )
+ result = stringify_values(data)
Review Comment:
**Suggestion:** Add an explicit type annotation for `result` instead of
leaving the inferred type unannotated. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The new test introduces a local `result` variable without a type annotation.
This is a newly added Python variable that can be annotated, so the suggestion
correctly identifies a real violation of the type-hint rule.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=90d444d6807647659cc6c155ce46dda1&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=90d444d6807647659cc6c155ce46dda1&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/result_set_test.py
**Line:** 540:540
**Comment:**
*Custom Rule: Add an explicit type annotation for `result` instead of
leaving the inferred type unannotated.
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%2F41533&comment_hash=05ea622bac3ce1c9be6e6a7aa87e899da8b24e087141abdacae3cf7c33dbe431&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41533&comment_hash=05ea622bac3ce1c9be6e6a7aa87e899da8b24e087141abdacae3cf7c33dbe431&reaction=dislike'>👎</a>
##########
tests/unit_tests/utils/json_tests.py:
##########
@@ -415,3 +415,17 @@ def test_format_timedelta():
json.format_timedelta(timedelta(0) - timedelta(days=16, hours=4,
minutes=3))
== "-16 days, 4:03:00"
)
+
+
+def test_dumps_escapes_non_ascii_by_default():
Review Comment:
**Suggestion:** Add an explicit return type annotation to this new test
function to satisfy the Python type-hint requirement. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This new Python test function omits a return type annotation. The custom
rule requires type hints on new or modified Python functions when they can be
annotated, so this is a real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=74cf0a7996254b718e1246011e5fc49e&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=74cf0a7996254b718e1246011e5fc49e&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/utils/json_tests.py
**Line:** 420:420
**Comment:**
*Custom Rule: Add an explicit return type annotation to this new test
function to satisfy the Python type-hint requirement.
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%2F41533&comment_hash=6a1d0742a77082c2055accfbc1dca582c3ad7170c04e05d596e2e7f7178393a9&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41533&comment_hash=6a1d0742a77082c2055accfbc1dca582c3ad7170c04e05d596e2e7f7178393a9&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]