sadpandajoe commented on code in PR #43771:
URL: https://github.com/apache/superset/pull/43771#discussion_r3922270702
##########
superset/mcp_service/chart/schemas.py:
##########
@@ -1045,6 +1063,518 @@ def reject_sql_expression_on_dimensions(self) ->
"PieChartConfig":
return self
+class SunburstStandardizedControls(UnknownFieldCheckMixin):
+ """Bounded shared controls retained by Explore across viz changes."""
+
+ model_config = ConfigDict(extra="ignore")
+
+ metrics: list[JsonValue] = Field(default_factory=list)
+ columns: list[JsonValue] = Field(default_factory=list)
+
+
+class SunburstStandardizedFormData(UnknownFieldCheckMixin):
+ """Validated shape of Explore's cross-plugin UI memory."""
+
+ model_config = ConfigDict(extra="ignore", populate_by_name=True)
+
+ controls: SunburstStandardizedControls
+ memorized_form_data: list[tuple[str, dict[str, JsonValue]]] = Field(
+ default_factory=list,
+ validation_alias=AliasChoices("memorized_form_data",
"memorizedFormData"),
+ serialization_alias="memorizedFormData",
+ )
+
+
+class SunburstNativeMetricColumn(UnknownFieldCheckMixin):
Review Comment:
Saved Sunburst charts with an adhoc SIMPLE metric can include normal
frontend column metadata such as `certified_by`; this validator rejects it
before the mapper extracts `column_name`, so generate/update cannot round-trip
those charts. Could the nested `column` model tolerate the full frontend
`ColumnMeta` shape while still validating the fields it consumes?
--
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]