Vitor-Avila commented on code in PR #28176:
URL: https://github.com/apache/superset/pull/28176#discussion_r1589736519


##########
superset/commands/report/base.py:
##########
@@ -76,3 +78,43 @@ def validate_chart_dashboard(
             self._properties["dashboard"] = dashboard
         elif not update:
             exceptions.append(ReportScheduleEitherChartOrDashboardError())
+
+    def validate_report_frequency(
+        self,
+        cron_schedule: str,
+        report_type: str,
+    ) -> None:
+        """
+        Validates if the report scheduled frequency doesn't exceed a limit
+        configured in `config.py`.
+
+        :param cron_schedule: The cron schedule configured.
+        :param report_type: The report type (Alert/Report).
+        """
+        config_key = (
+            "ALERT_MINIMUM_INTERVAL_MINUTES"
+            if report_type == ReportScheduleType.ALERT
+            else "REPORT_MINIMUM_INTERVAL_MINUTES"
+        )
+        minimum_interval = current_app.config.get(config_key)

Review Comment:
   great catch! Just fixed that



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