codeant-ai-for-open-source[bot] commented on code in PR #42103:
URL: https://github.com/apache/superset/pull/42103#discussion_r3592857804
##########
scripts/translations/backfill_po.py:
##########
@@ -138,6 +138,22 @@ def _lang_name(code: str) -> str:
return LANGUAGE_NAMES.get(code, code)
+# An ISO 639-1/639-2 code, optionally followed by an ISO 3166 region
+# (``_BR``, two uppercase) or an ISO 15924 script (``_Latn``, titlecase). The
+# script subtag matters for catalogs like ``sr_Latn`` (Serbian in Latin
script);
+# without it the code was rejected and the catalog silently skipped.
+_LANG_CODE_RE = re.compile(r"[a-z]{2,3}(_([A-Z]{2}|[A-Z][a-z]{3}))?")
Review Comment:
**Suggestion:** Add an explicit type annotation for this compiled regex
constant (for example, a pattern type) to satisfy the typing requirement for
new variables. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The new module-level regex constant is unannotated even though it can be
typed, which matches the rule requiring type hints on relevant new Python
variables.
</details>
<details>
<summary><b>Rule source ๐ </b></summary>
.cursor/rules/dev-standard.mdc (line 28)
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=af285955fe6945bd92b674ebf1a9c295&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=af285955fe6945bd92b674ebf1a9c295&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:** scripts/translations/backfill_po.py
**Line:** 145:145
**Comment:**
*Custom Rule: Add an explicit type annotation for this compiled regex
constant (for example, a pattern type) to satisfy the typing requirement for
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%2F42103&comment_hash=55885710e6990ddab779407e7b0a18dfef5de7e0b98837114fa277de4f2e8519&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42103&comment_hash=55885710e6990ddab779407e7b0a18dfef5de7e0b98837114fa277de4f2e8519&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]