Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(empty dashboards): Allow downloading a screenshot of an empty dashboard #30767

Merged
merged 7 commits into from
Nov 13, 2024
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
Loading