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


##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -312,6 +339,29 @@ class GetDashboardInfoRequest(MetadataCacheControl):
             "from that permalink."
         ),
     )
+    select_columns: Annotated[
+        List[str],
+        Field(
+            default_factory=lambda: list(DEFAULT_GET_DASHBOARD_INFO_COLUMNS),
+            description=(
+                "Top-level fields to include in the response. Defaults to a 
lean "
+                "set that excludes 'css' (raw CSS, can be many KB) and 
'filter_state' "
+                "(only relevant when permalink_key is provided). Pass an 
explicit list "
+                "to override, e.g. ['id','dashboard_title','charts'] for 
minimal "
+                "output, or add 'css' to include raw dashboard CSS."
+            ),
+        ),
+    ]
+
+    @field_validator("select_columns", mode="before")
+    @classmethod
+    def _parse_select_columns(cls, value: Any) -> Any:
+        from superset.mcp_service.utils.schema_utils import parse_json_or_list
+
+        if value is None:
+            return list(DEFAULT_GET_DASHBOARD_INFO_COLUMNS)
+        result = parse_json_or_list(value, "select_columns")
+        return result or list(DEFAULT_GET_DASHBOARD_INFO_COLUMNS)

Review Comment:
   **🟠 Architect Review — HIGH**
   
   DEFAULT_GET_DASHBOARD_INFO_COLUMNS includes "filter_state" even though the 
select_columns field description says the lean default excludes "filter_state"; 
default get_dashboard_info responses will therefore still include the permalink 
filter_state payload when present, contradicting the contract and undermining 
the size-reduction intent.
   
   **Suggestion:** Remove "filter_state" from 
DEFAULT_GET_DASHBOARD_INFO_COLUMNS (and only include it when explicitly 
requested or when permalink_key is present), or update the docs to match and 
add a regression test for permalink responses to guarantee they stay under the 
middleware limit.
   
   
   [Fix in 
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=db7f9ccd292d4f489f15c3f0c744c228&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=db7f9ccd292d4f489f15c3f0c744c228&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 an **Architect / Logical Review** comment left during a code review. 
These reviews are first-class, important findings — not optional suggestions. 
Do NOT dismiss this as a 'big architectural change' just because the title says 
architect review; most of these can be resolved with a small, localized fix 
once the intent is understood.
   
   **Path:** superset/mcp_service/dashboard/schemas.py
   **Line:** 291:364
   **Comment:**
        *HIGH: DEFAULT_GET_DASHBOARD_INFO_COLUMNS includes "filter_state" even 
though the select_columns field description says the lean default excludes 
"filter_state"; default get_dashboard_info responses will therefore still 
include the permalink filter_state payload when present, contradicting the 
contract and undermining the size-reduction intent.
   
   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.
   If a suggested approach is provided above, use it as the authoritative 
instruction. If no explicit code suggestion is given, you MUST still draft and 
apply your own minimal, localized fix — do not punt back with 'no suggestion 
provided, review manually'. Keep the change as small as possible: add a guard 
clause, gate on a loading state, reorder an await, wrap in a conditional, etc. 
Do not refactor surrounding code or expand scope beyond the finding.
   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>



-- 
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