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


##########
superset/datasets/schemas.py:
##########
@@ -421,7 +434,7 @@ def fix_template_params(
     metric_type = fields.String(allow_none=True)
     expression = fields.String(required=True)
     description = fields.String(allow_none=True)
-    d3format = fields.String(allow_none=True)
+    d3format = fields.String(allow_none=True, validate=validate_d3format)

Review Comment:
   **Suggestion:** This import schema checks only syntax, so a valid-looking 
value longer than the model's 128-character column passes validation and can 
make bundle persistence fail.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Incomplete 
implementation`
   
   [![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=b21dc6930b814d16863180ce9d49cbdd&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=b21dc6930b814d16863180ce9d49cbdd&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/datasets/schemas.py
   **Line:** 437:437
   **Comment:**
        *Incomplete Implementation: This import schema checks only syntax, so a 
valid-looking value longer than the model's 128-character column passes 
validation and can make bundle persistence fail.
   
   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%2F45633&comment_hash=b58e7cd939b4f26c026b91ab0a29d13fcbf4d4b5be5cbbb68dbeb842bba0be27&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45633&comment_hash=b58e7cd939b4f26c026b91ab0a29d13fcbf4d4b5be5cbbb68dbeb842bba0be27&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset/mcp_service/dataset/schemas.py:
##########
@@ -475,6 +476,16 @@ def expression_must_aggregate(cls, value: str) -> str:
             )
         return value
 
+    @field_validator("d3format")
+    @classmethod
+    def d3format_must_be_valid(cls, value: str | None) -> str | None:
+        if not is_valid_d3_format(value):
+            raise ValueError(
+                "Invalid number format: must be a d3-format specifier or a "
+                "supported named format"
+            )
+        return value

Review Comment:
   **Suggestion:** This creation schema checks grammar but has no length cap, 
so an over-128-character format reaches the `String(128)` column and can make 
virtual-dataset creation fail.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Incomplete 
implementation`
   
   [![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=7e8b21713c37419ab9baf796a6459dae&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=7e8b21713c37419ab9baf796a6459dae&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/mcp_service/dataset/schemas.py
   **Line:** 479:487
   **Comment:**
        *Incomplete Implementation: This creation schema checks grammar but has 
no length cap, so an over-128-character format reaches the `String(128)` column 
and can make virtual-dataset creation fail.
   
   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%2F45633&comment_hash=084e92bcb1c1b3b84ae1d7fe366dfc0597f28b1a70fbb78e4744798ff94ce18e&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45633&comment_hash=084e92bcb1c1b3b84ae1d7fe366dfc0597f28b1a70fbb78e4744798ff94ce18e&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