alexandrusoare commented on code in PR #45091:
URL: https://github.com/apache/superset/pull/45091#discussion_r4219731947
##########
superset/datasets/schemas.py:
##########
@@ -79,7 +79,33 @@ def validate_python_date_format(dt_format: str) -> bool:
return True
-class DatasetColumnsPutSchema(Schema):
+class DiscardCertificationMetadataMixin(Schema):
+ """Accept and discard the certification/warning keys the GET exposes.
+
+ ``certification_details``, ``certified_by``, ``is_certified`` and
+ ``warning_markdown`` are read-only model properties derived from the
+ JSON in ``extra``. Clients that echo a GET payload back on PUT would
+ otherwise be rejected with "Unknown field", and ``extra`` already
+ carries the values, so dropping the keys loses nothing.
+ """
+
+ # pylint: disable=unused-argument
+ @pre_load
+ def _discard_certification_metadata(
+ self, data: dict[str, Any], **kwargs: Any
+ ) -> dict[str, Any]:
+ if isinstance(data, dict):
+ for key in (
Review Comment:
Should the mixin also drop type_generic, created_on and changed_on?
--
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]