msyavuz opened a new pull request, #45091:
URL: https://github.com/apache/superset/pull/45091
### SUMMARY
#43319 added `certification_details`, `certified_by`, `is_certified` and
`warning_markdown` to the columns and metrics returned by `GET
/api/v1/dataset/<id>`. They are read-only properties derived from `extra`, and
the column/metric PUT schemas are strict, so any client that echoes a GET
payload back on `PUT /api/v1/dataset/<id>` now gets 422 `MARSHMALLOW_ERROR`
with "Unknown field." for each of the four keys. This breaks `preset-cli
superset sync dbt-core` (and any similar round-tripping client) on 6.1, while
6.0 works.
This adds a `@pre_load` mixin to both PUT schemas that drops the four keys,
following the existing `DiscardIsManagedExternallyMixin` pattern. Dropping is
lossless: `extra` is still accepted and is the source of truth for those values.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A, API-only.
### TESTING INSTRUCTIONS
1. `GET /api/v1/dataset/<id>` and take `result.columns` (or
`result.metrics`).
2. `PUT /api/v1/dataset/<id>?override_columns=false` with `{"columns":
[...]}` unchanged.
3. Before: 422 with `"certified_by": ["Unknown field."]` etc. per column.
After: 200.
Unit test added in `tests/unit_tests/datasets/schema_tests.py`.
### ADDITIONAL INFORMATION
- [ ] Has associated issue: No
- [ ] Required feature flags: None
- [ ] Changes UI: No
- [ ] Includes DB Migration: No
- [ ] Introduces new feature or API: No
- [ ] Removes existing feature or API: No
--
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]