vnourdin commented on a change in pull request #13157:
URL: https://github.com/apache/superset/pull/13157#discussion_r578306009
##########
File path: superset/reports/commands/execute.py
##########
@@ -152,11 +152,19 @@ def _get_screenshot(self) -> ScreenshotData:
screenshot: Optional[BaseScreenshot] = None
if self._report_schedule.chart:
url = self._get_url(standalone="true")
- screenshot = ChartScreenshot(url,
self._report_schedule.chart.digest)
+ screenshot = ChartScreenshot(
+ url,
+ self._report_schedule.chart.digest,
+ window_size=app.config["WEBDRIVER_WINDOW"]["slice"],
Review comment:
Why passing this as a default value, it's already the default value in
your `ChartScreenshot` __init__ :shrug:
Same for DashboardScreenshot.
##########
File path: superset/utils/screenshots.py
##########
@@ -195,12 +195,34 @@ def resize_image(
class ChartScreenshot(BaseScreenshot):
thumbnail_type: str = "chart"
element: str = "chart-container"
- window_size: WindowSize = (800, 600)
- thumb_size: WindowSize = (800, 600)
+
+ def __init__(
+ self,
+ url: str,
+ digest: str,
+ window_size: Optional[WindowSize] = None,
+ thumb_size: Optional[WindowSize] = None,
+ ):
+ super().__init__(url, digest)
+ self.window_size = (
+ window_size or current_app.config["WEBDRIVER_WINDOW"]["slice"]
+ )
+ self.thumb_size = thumb_size or (800, 600)
Review comment:
Why hard-coding this value instead of using the same as `window_size`? I
don't know what it's used for, I'll dig maybe you can enlighten me :wink:
----------------------------------------------------------------
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]