Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
defining defaults in thumbnails.py caused thumbnail caches invalidated.
they moved to init.
  • Loading branch information
Ibrahim Ercan committed Feb 28, 2021
1 parent 07a028f commit f4cec93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions superset/tasks/thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def cache_chart_thumbnail(
logger.warning("No cache set, refusing to compute")
return None
logger.info("Caching chart: %s", url)
screenshot = ChartScreenshot(url, digest, (800, 600), (800, 600))
screenshot = ChartScreenshot(url, digest)
with session_scope(nullpool=True) as session:
user = security_manager.get_user_by_username(
current_app.config["THUMBNAIL_SELENIUM_USER"], session=session
Expand All @@ -68,7 +68,7 @@ def cache_dashboard_thumbnail(
logging.warning("No cache set, refusing to compute")
return
logger.info("Caching dashboard: %s", url)
screenshot = DashboardScreenshot(url, digest, (1600, 1200), (800, 600))
screenshot = DashboardScreenshot(url, digest)
with session_scope(nullpool=True) as session:
user = security_manager.get_user_by_username(
current_app.config["THUMBNAIL_SELENIUM_USER"], session=session
Expand Down
8 changes: 2 additions & 6 deletions superset/utils/screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ def __init__(
thumb_size: Optional[WindowSize] = None,
):
super().__init__(url, digest)
self.window_size = (
window_size or current_app.config["WEBDRIVER_WINDOW"]["slice"]
)
self.window_size = window_size or (800, 600)
self.thumb_size = thumb_size or (800, 600)


Expand All @@ -222,7 +220,5 @@ def __init__(
thumb_size: Optional[WindowSize] = None,
):
super().__init__(url, digest)
self.window_size = (
window_size or current_app.config["WEBDRIVER_WINDOW"]["dashboard"]
)
self.window_size = window_size or (1600, 1200)
self.thumb_size = thumb_size or (800, 600)

0 comments on commit f4cec93

Please sign in to comment.