codeant-ai-for-open-source[bot] commented on code in PR #41056:
URL: https://github.com/apache/superset/pull/41056#discussion_r3414955773
##########
superset/charts/schemas.py:
##########
@@ -1454,6 +1454,21 @@ class Meta: # pylint: disable=too-few-public-methods
allow_none=True,
)
+ @post_load
+ def rename_deprecated_fields(
+ self, data: dict[str, Any], **kwargs: Any
+ ) -> dict[str, Any]:
+ _renames = (
+ ("groupby", "columns"),
+ ("granularity_sqla", "granularity"),
+ ("timeseries_limit", "series_limit"),
+ ("timeseries_limit_metric", "series_limit_metric"),
+ )
+ for old, new in _renames:
+ if value := data.pop(old, None):
+ data[new] = value
+ return data
Review Comment:
**Suggestion:** Add a docstring to this newly added method to describe that
it remaps deprecated query keys to their replacement keys during schema
post-processing. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is a newly added method and it does not include a docstring. The custom
rule requires new Python functions and classes to be documented inline, so this
is a real violation.
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e59c6183f3604a3098d5db8b1628f87e&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
| [Fix in VSCode
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=e59c6183f3604a3098d5db8b1628f87e&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:** superset/charts/schemas.py
**Line:** 1457:1470
**Comment:**
*Custom Rule: Add a docstring to this newly added method to describe
that it remaps deprecated query keys to their replacement keys during schema
post-processing.
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%2F41056&comment_hash=c31c8b313159c849f1be4d92ffd0355d174c80ed5a0f7ad20e4beeaffa2c8faa&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41056&comment_hash=c31c8b313159c849f1be4d92ffd0355d174c80ed5a0f7ad20e4beeaffa2c8faa&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]