sadpandajoe commented on code in PR #45357:
URL: https://github.com/apache/superset/pull/45357#discussion_r4327978713


##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -326,9 +507,32 @@ class GetDashboardInfoRequest(MetadataCacheControl):
             "Restricted users receive native_filter_values (names, types, 
values, "
             "labels, exclusion flags), not raw dataMask/column targets. "
             "native_filter_values_incomplete flags unsupported filters/chart 
state "
-            "that cannot be summarized safely."
+            "that cannot be summarized safely. Choice discovery requires 
dataMask."
+        ),
+    )
+    include_filter_values: StrictBool = Field(
+        default=False,
+        description=(
+            "Discover dropdown choices for changing selections, not analytical 
results."
         ),
     )
+    filter_value_requests: list[FilterValueRequest] | None = Field(
+        default=None,
+        min_length=1,
+        max_length=20,
+        description="Unique IDs; literal search or strict exact_value, 
including null.",
+    )
+    filter_values_offset: StrictInt = Field(

Review Comment:
   The request model advertises `filter_value_requests: null`, 
`filter_values_offset: 0` and `proposed_filter_values: null` as schema 
defaults, but `_validate_discovery_controls` treats any of them in 
`model_fields_set` without `include_filter_values=true` as an error. A client 
that materializes schema defaults (`include_filter_values: false, 
filter_value_requests: null, filter_values_offset: 0, proposed_filter_values: 
null`) on an ordinary `get_dashboard_info` call gets `Discovery controls 
require include_filter_values=true`, so a previously working metadata call is 
rejected (I confirmed the same defaults-then-validate rejection with a minimal 
pydantic model of these fields). `FilterValueRequest` already strips these 
defaults with `_omit_mode_default`; should the three request-level controls do 
the same so the schema doesn't advertise values the validator rejects?



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