ktmud commented on code in PR #20552:
URL: https://github.com/apache/superset/pull/20552#discussion_r928025912
##########
superset/reports/models.py:
##########
@@ -147,25 +147,27 @@ class ReportSchedule(Model, AuditMixinNullable):
# (Alerts/Reports) Unlock a possible stalled working state
working_timeout = Column(Integer, default=60 * 60 * 1)
- # Store the selected dashboard tabs etc.
- extra = Column(Text, default="{}")
-
# (Reports) When generating a screenshot, bypass the cache?
force_screenshot = Column(Boolean, default=False)
+ extra: ReportScheduleExtra # type: ignore
+
def __repr__(self) -> str:
return str(self.name)
@renders("crontab")
def crontab_humanized(self) -> str:
return get_description(self.crontab)
- @validates("extra")
- # pylint: disable=unused-argument,no-self-use
- def validate_extra(self, key: str, value: Dict[Any, Any]) -> Optional[str]:
- if value is not None:
- return json.dumps(value)
- return None
+ @validates("extra_json")
Review Comment:
Maybe it should! Just thought we may do more advanced validation here based
on entity types but I guess they can have multiple `validates` function anyway?
--
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]