rusackas opened a new pull request, #42732:
URL: https://github.com/apache/superset/pull/42732

   ### SUMMARY
   Test-only PR pinning the bug reported in #42626: only the 10 top-level MCP 
chart config models (`PieChartConfig`, `XYChartConfig`, etc.) inherit 
`UnknownFieldCheckMixin`, which rejects unknown fields with a "did you mean?" 
suggestion. The nested sub-models they're composed of — `AxisConfig`, 
`LegendConfig`, `CurrencyFormat`, `FilterConfig`, `SortByConfig`, `ColumnRef` — 
are plain `BaseModel`, so pydantic's default `extra="ignore"` silently drops a 
typo'd field one level down instead of raising.
   
   This is worse than a plain rejection for an MCP client (especially an LLM 
driving one): `update_chart` returns `success: true` with no warnings, so the 
caller has no signal the setting it just sent was silently dropped. The 
reporter's own repro shows three successive `update_chart` calls each returning 
success while changing nothing.
   
   Currently red: `AxisConfig.model_validate()` with an unknown field succeeds 
today instead of raising, documenting the gap. Does not fix the bug — the 
reporter's suggested fix (have the nested models inherit 
`UnknownFieldCheckMixin` instead of `BaseModel`) looks correct and mechanical, 
but is left for a follow-up so this PR stays test-only.
   
   ### TESTING INSTRUCTIONS
   ```
   pytest tests/unit_tests/mcp_service/chart/test_chart_schemas.py -k 
test_unknown_field_nested_one_level_down_is_rejected
   ```
   Fails today (red), pinning the bug. The rest of the file (106 other tests) 
is unaffected.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: #42626
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


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