alexandrusoare commented on code in PR #43553:
URL: https://github.com/apache/superset/pull/43553#discussion_r3863487930
##########
superset/reports/schemas.py:
##########
@@ -180,7 +189,31 @@ def validate_addresses(field: str, value: str | None,
required: bool) -> None:
validate_addresses("bccTarget", config.get("bccTarget"),
required=False)
-class ReportSchedulePostSchema(Schema):
+_RETRY_FIELD_KEYS = (
+ "retry_on_failure",
+ "retry_max_attempts",
+ "send_failed_reports",
+ "retry_notify_owners",
+ "retry_notify_recipients",
+)
+
+
+class RetryFieldStripMixin:
+ """Strip retry fields from the deserialized payload when the feature is
off."""
+
+ @post_load
+ def strip_retry_fields_if_disabled(
+ self,
+ data: dict[str, Any],
+ **kwargs: Any,
+ ) -> dict[str, Any]:
+ if not is_feature_enabled("ALERT_REPORTS_RETRY"):
+ for key in _RETRY_FIELD_KEYS:
+ data.pop(key, None)
+ return data
Review Comment:
Fixed it
--
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]