codeant-ai-for-open-source[bot] commented on code in PR #40919:
URL: https://github.com/apache/superset/pull/40919#discussion_r4165939818


##########
superset-frontend/src/components/FilterableTable/utils.tsx:
##########
@@ -45,7 +45,7 @@ export const renderResultCell = ({
   const cellNode =
     getCellContent?.({ cellData, columnKey }) ?? String(cellData);
   if (cellData === null) {
-    return <i className="text-muted">{NULL_STRING}</i>;
+    return <i className="text-muted">{NULL_STRING()}</i>;

Review Comment:
   **Suggestion:** This renders the `NULL` translation key instead of the 
shared `<NULL>` key, so customized null labels are not applied in 
FilterableTable.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes` ยท ๐Ÿท๏ธ `Inconsistent 
naming`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=0c1c0c03818e48d4ab9fd81d9273c843&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=0c1c0c03818e48d4ab9fd81d9273c843&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/components/FilterableTable/utils.tsx
   **Line:** 48:48
   **Comment:**
        *Inconsistent Naming: This renders the `NULL` translation key instead 
of the shared `<NULL>` key, so customized null labels are not applied in 
FilterableTable.
   
   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%2F40919&comment_hash=1ea8c90d202aa50273d2fd78a15bd386465ad0a53f1405dac0a8a67c39546fca&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40919&comment_hash=1ea8c90d202aa50273d2fd78a15bd386465ad0a53f1405dac0a8a67c39546fca&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset/constants.py:
##########
@@ -15,17 +15,21 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# ATTENTION: If you change any constants, make sure to also change 
utils/common.js
+# ATTENTION: If you change any constants, make sure to also change
+# plugins/plugin-chart-echarts/src/constants.ts
 
 # string to use when None values *need* to be converted to/from strings
 from enum import Enum
 
+from flask_babel import lazy_gettext as __
+
 from superset.utils.backports import StrEnum
 
 DEFAULT_USER_AGENT = "Apache Superset"
 
-NULL_STRING = "<NULL>"
-EMPTY_STRING = "<empty string>"
+# Keep in sync with 
superset-frontend/plugins/plugin-chart-echarts/src/constants.ts
+NULL_STRING = __("<NULL>")
+EMPTY_STRING = __("<empty string>")

Review Comment:
   **Suggestion:** Saved filters containing the invariant `<NULL>` or `<empty 
string>` stop matching under translated locales, so existing dashboard filters 
can no longer be converted to SQL NULL or an empty string.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes` ยท ๐Ÿท๏ธ `Api mismatch`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=09060039e7cc4a2794a039ee7e7dddf0&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=09060039e7cc4a2794a039ee7e7dddf0&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/constants.py
   **Line:** 31:32
   **Comment:**
        *Api Mismatch: Saved filters containing the invariant `<NULL>` or 
`<empty string>` stop matching under translated locales, so existing dashboard 
filters can no longer be converted to SQL NULL or an empty string.
   
   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%2F40919&comment_hash=334a8fa316560fc98d2473de0a921bea9d58bd4b2fc86f96e68672775d4bc555&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40919&comment_hash=334a8fa316560fc98d2473de0a921bea9d58bd4b2fc86f96e68672775d4bc555&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx:
##########
@@ -124,7 +124,7 @@ export default function EchartsTreemap({
           const drillToDetailFilters: BinaryQueryObjectFilterClause[] = [];
           const drillByFilters: BinaryQueryObjectFilterClause[] = [];
           treePath.forEach((path, i) => {
-            const val = path === 'null' ? NULL_STRING : path;
+            const val = path === 'null' ? NULL_STRING() : path;

Review Comment:
   **Suggestion:** A real category named `null` is converted to the null 
sentinel, so drilling from that category filters for SQL NULL instead of the 
literal category value.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes` ยท ๐Ÿท๏ธ `Api mismatch`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=bb7dd5cb998546ed830035d5e08dd395&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=bb7dd5cb998546ed830035d5e08dd395&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx
   **Line:** 127:127
   **Comment:**
        *Api Mismatch: A real category named `null` is converted to the null 
sentinel, so drilling from that category filters for SQL NULL instead of the 
literal category value.
   
   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%2F40919&comment_hash=48687349ee2e25f26cb036f37c76b31ce0316061328f6c459c4e32b0ce1a2a71&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40919&comment_hash=48687349ee2e25f26cb036f37c76b31ce0316061328f6c459c4e32b0ce1a2a71&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]

Reply via email to