codeant-ai-for-open-source[bot] commented on code in PR #44816:
URL: https://github.com/apache/superset/pull/44816#discussion_r4140629005
##########
superset/datasets/api.py:
##########
@@ -210,6 +260,7 @@ class DatasetRestApi(SoftDeleteApiMixin,
BaseSupersetModelRestApi):
"get_or_create_dataset",
"warm_up_cache",
"get_drill_info",
+ "partition_mapping_preview",
Review Comment:
**Suggestion:** The new route is not mapped to the dataset `write`
permission, so `@protect()` falls back to an undefined method permission and
normal editors cannot use the preview.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ad6ff17843604ea1b5974ef69959b80a&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=ad6ff17843604ea1b5974ef69959b80a&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/api.py
**Line:** 263:263
**Comment:**
*Api Mismatch: The new route is not mapped to the dataset `write`
permission, so `@protect()` falls back to an undefined method permission and
normal editors cannot use the preview.
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%2F44816&comment_hash=cfc9892af74b8b0206711e7ae1c189a0560043c60e925e8c7ff79e6126f8672c&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44816&comment_hash=cfc9892af74b8b0206711e7ae1c189a0560043c60e925e8c7ff79e6126f8672c&reaction=dislike'>๐</a>
##########
superset/datasets/schemas.py:
##########
@@ -101,6 +192,22 @@ class DatasetColumnsPutSchema(Schema):
datetime_format = fields.String(
allow_none=True, validate=[Length(1, 100), validate_python_date_format]
)
+ partition_value_transform = fields.String(
+ allow_none=True,
+ metadata={
+ "description": (
+ "SQL expression containing a :value placeholder. Filters on "
+ "this column are mirrored onto the dataset's partition column "
+ "with the value passed through this transform."
+ )
+ },
+ )
Review Comment:
**Suggestion:** `partition_value_transform` has no length validator, so
oversized values pass validation, are stored, then are silently ignored by
`parse_mapping` after consuming parser and validation resources.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Possible bug`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=5aa79b0109d8401595f5b76b832044f6&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=5aa79b0109d8401595f5b76b832044f6&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:** 195:204
**Comment:**
*Possible Bug: `partition_value_transform` has no length validator, so
oversized values pass validation, are stored, then are silently ignored by
`parse_mapping` after consuming parser and validation resources.
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%2F44816&comment_hash=28b557d736f387c2361e444a7597ae8bf761f6ee6fa33a109d5efc42a94f547e&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44816&comment_hash=28b557d736f387c2361e444a7597ae8bf761f6ee6fa33a109d5efc42a94f547e&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]