Skip to content

Commit

Permalink
fix(empty dashboards): Allow downloading a screenshot of an empty das…
Browse files Browse the repository at this point in the history
…hboard (apache#30767)

Co-authored-by: Geido <[email protected]>
  • Loading branch information
msyavuz and geido authored Nov 13, 2024
1 parent a7069e6 commit 58f9be9
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions superset/utils/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,19 @@ def get_screenshot(self, url: str, element_name: str, user: User) -> bytes | Non
)
)
except TimeoutException:
logger.exception(
"Selenium timed out waiting for chart containers to draw at url %s",
url,
)
raise
# Fallback to allow a screenshot of an empty dashboard
try:
WebDriverWait(driver, 0).until(
EC.visibility_of_all_elements_located(
(By.CLASS_NAME, "grid-container")
)
)
except:
logger.exception(
"Selenium timed out waiting for dashboard to draw at url %s",
url,
)
raise

try:
# charts took too long to load
Expand Down

0 comments on commit 58f9be9

Please sign in to comment.