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


##########
superset/extensions/api.py:
##########
@@ -15,41 +15,34 @@
 # specific language governing permissions and limitations
 # under the License.
 import mimetypes
-import re
 from io import BytesIO
 from typing import Any
 
 from flask import send_file
 from flask.wrappers import Response
-from flask_appbuilder.api import expose, protect, safe
+from flask_appbuilder.api import BaseApi, expose, protect, safe
 
 from superset.extensions.utils import (
     build_extension_data,
     get_extensions,
 )
-from superset.views.base_api import BaseSupersetApi
 
-# Allowlist for publisher and name path parameters — alphanumeric, hyphens,
-# underscores only. Rejects path-traversal attempts (../), URL-encoded slashes,
-# and any other characters that could escape EXTENSIONS_PATH.
-_SEGMENT_RE = re.compile(r"^[A-Za-z0-9_-]+$")
 
+class ExtensionsRestApi(BaseApi):

Review Comment:
   **Suggestion:** Add a class docstring immediately under the class definition 
to document the API class purpose and behavior. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new `ExtensionsRestApi` class is introduced in the changed hunk and has 
no class docstring immediately under the definition. This matches the custom 
rule requiring newly added Python classes to be documented inline.
   </details>
   
   [![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=d9c14ba5c0794bb982568821a92d010e&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=d9c14ba5c0794bb982568821a92d010e&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/extensions/api.py
   **Line:** 31:31
   **Comment:**
        *Custom Rule: Add a class docstring immediately under the class 
definition to document the API class purpose and behavior.
   
   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%2F41116&comment_hash=855d340375a78b70bcb7a9af608db093a6486f0e8d404c3f4ddf8aef23da31f2&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41116&comment_hash=855d340375a78b70bcb7a9af608db093a6486f0e8d404c3f4ddf8aef23da31f2&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