codeant-ai-for-open-source[bot] commented on code in PR #45828:
URL: https://github.com/apache/superset/pull/45828#discussion_r4434040697
##########
superset/mcp_service/chart/chart_helpers.py:
##########
@@ -1165,6 +1187,36 @@ def coerce_enum_values(value: Any) -> Any:
return value
+def _query_semantic_selection_version(
+ form_data: dict[str, Any], extra_form_data: dict[str, Any] | None
+) -> str | None:
+ """Mirror Explore's version transport without certifying external
selections."""
+ version: object = form_data.get("semantic_selection_version")
+ if not isinstance(version, str):
+ return None
+ unverified: str = "unverified-external-selections"
+ sources: list[Any] = list(form_data.get("semantic_selection_sources") or
[])
+ extra: dict[str, Any]
+ for extra in (form_data.get("extra_form_data") or {}, extra_form_data or
{}):
+ if extra.get("semantic_selection_sources"):
+ sources.extend(extra["semantic_selection_sources"])
+ elif any(extra.get(key) for key in SEMANTIC_SELECTION_MEMBER_KEYS):
+ return unverified
Review Comment:
**Suggestion:** A caller can pair stale member filters with a matching
source record in `extra_form_data`; the query forwards the current version and
may resolve an old ID under the wrong identity scheme.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Security`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4919211c9fe64c30b30107be2f7925b6&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=4919211c9fe64c30b30107be2f7925b6&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/chart/chart_helpers.py
**Line:** 1201:1204
**Comment:**
*Security: A caller can pair stale member filters with a matching
source record in `extra_form_data`; the query forwards the current version and
may resolve an old ID under the wrong identity scheme.
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%2F45828&comment_hash=2ed6d66ef6e30423edc81bb89c43e84f8db2f90a40df8a548a70fbf14301670f&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45828&comment_hash=2ed6d66ef6e30423edc81bb89c43e84f8db2f90a40df8a548a70fbf14301670f&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]