lilykuang commented on a change in pull request #13828:
URL: https://github.com/apache/superset/pull/13828#discussion_r608710710



##########
File path: superset/reports/commands/execute.py
##########
@@ -190,23 +202,50 @@ def _get_screenshot(self) -> bytes:
             raise ReportScheduleScreenshotFailedError()
         return image_data
 
+    def _get_csv_data(self) -> bytes:
+        if self._report_schedule.chart:
+            url = self._get_url(csv=True)
+            auth_cookies = 
machine_auth_provider_factory.instance.get_auth_cookies(
+                self._get_screenshot_user()
+            )
+        try:
+            csv_data = get_chart_csv_data(url, auth_cookies)
+        except SoftTimeLimitExceeded:
+            raise ReportScheduleScreenshotTimeout()
+        except Exception as ex:
+            raise ReportScheduleCsvFailedError(f"Failed generating csv 
{str(ex)}")
+        if not csv_data:

Review comment:
       It will be considered as an error 
   [this function return None if  no 
data](https://github.com/apache/superset/pull/13828/files#diff-277eb734a49b1e015aa69daddc520f256f3262599f3ba746ef3e7d5e95a25bddR84-R86)
   `ReportScheduleCsvFailedError()` will be raised




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to