aminghadersohi commented on code in PR #45828:
URL: https://github.com/apache/superset/pull/45828#discussion_r4434234131


##########
superset/mcp_service/chart/chart_helpers.py:
##########
@@ -1165,6 +1165,49 @@ 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"):

Review Comment:
   Confirmed at b658756db4: `merge_semantic_selection_sources` keeps a 
placeholder for inputs without provenance, so the scope-plus-request-filters 
case, both merge orders, repeated merges and the saved query-context path now 
fall back to unverified. The new tests fail on 48c99bfbe9.



##########
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:
   Not a new capability: the caller only vouches for its own request 
selections, and `/api/v1/chart/data` already accepts a caller-set 
`extras.semantic_selection_version` (`superset/charts/schemas.py:1195`); 
Explore's `extractExtras.ts` trusts the same source records. No trust boundary 
is crossed.



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

  • [PR] fix(mc... via GitHub
    • Re: [P... via GitHub
    • Re: [P... via GitHub
    • Re: [P... aminghadersohi (via GitHub) via notifications
    • Re: [P... mikebridge (via GitHub) via notifications
    • Re: [P... aminghadersohi (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications

Reply via email to