You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/02/16 21:02:16 UTC

[GitHub] [superset] willbarrett commented on a change in pull request #13150: feat(alerts): apply SQL limit to all alerts

willbarrett commented on a change in pull request #13150:
URL: https://github.com/apache/superset/pull/13150#discussion_r577135522



##########
File path: superset/reports/commands/alert.py
##########
@@ -117,7 +117,10 @@ def validate(self) -> None:
         )
         rendered_sql = sql_template.process_template(self._report_schedule.sql)
         try:
-            df = self._report_schedule.database.get_df(rendered_sql)
+            limited_rendered_sql = self._report_schedule.database.apply_limit_to_sql(
+                rendered_sql, 1

Review comment:
       I'm wondering if we should set the limit to 2 - the system expects a single row and raises an error if multiple rows are returned. This error could surface an issue with the query, or the data being accessed. Setting the limit to 1 changes the behavior of the query in a way that could hide issues.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org