aminghadersohi commented on PR #43770:
URL: https://github.com/apache/superset/pull/43770#issuecomment-5768491305

   Fixed the dimension-less Bullet acceptance failure in 
fdfc3d6632635b51426b6b470a54081bd11bd9f8.
   
   ### Confirmed cause
   Direct `BulletChartConfig.model_validate()` succeeds when `dimensions` is 
omitted. However, `generate_chart` then called `request.model_dump()` before 
the validation pipeline, inserting `dimensions: None` and all other defaults. 
Revalidation rejected that value with the reported `config -> bullet: ... 
dimensions must be an array` error.
   
   No `groupby` was injected in this reproduction: it failed in the adapter's 
later array-conversion loop, **not** the two-alias conflict check. Merely 
changing the conflict guard would therefore have left the simplest request 
broken.
   
   ### Fix and scope
   - Preserve omitted fields, including nested controls, with 
`exclude_unset=True` at the generation-to-validation boundary. Retain 
`chart_type` explicitly for typed callers relying on its default discriminator.
   - Treat null `dimensions`/`groupby` as absent before Bullet alias checking 
and adaptation. Omitted/null hierarchies preserve saved state; `dimensions: []` 
still explicitly clears it. Conflicting non-null aliases remain errors.
   - This serialization exposure is **shared by all 15 typed configs**, not 
just Bullet. Auditing all 22 published examples found Gauge, xy and the other 
types tolerate their dumped defaults, but the dump still loses omission 
provenance. The boundary fix applies to all types; added Gauge/xy/table/Bullet 
tests include nested axis/table controls.
   - `update_chart` does not use the same full-dump boundary. Its 
omitted-dimensions case passed the local pre-fix tool test; explicit null 
failed before and passes after. Updated regressions cover omitted/null input 
against both empty and populated saved hierarchies.
   
   ### Verification
   The new `test_generate_chart_creates_bullet_with_dimensions_omitted` omits 
the key entirely, exercises real schema validation and dataset normalization, 
and asserts successful creation and the payload sent to the mocked database 
command. **Confirmed fails before the fix with the reported validation error; 
passes afterward.** It does not substitute `dimensions: []`.
   
   279 Bullet/generate-chart tests pass; staged-file pre-commit and explicit 
mypy pass. Full MCP testing and CI for the new head are being checked. 
Documentation explains omission/null versus explicit clearing. No frontend 
rendering behavior changed.
   


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