mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: enable ruff lint rule TRY201 and B904 to improve raise stack traces (#29166)
This commit is contained in:
committed by
GitHub
parent
5167d20f27
commit
4bb2e2f8af
@@ -180,9 +180,9 @@ class WebDriverPlaywright(WebDriverProxy):
|
||||
)
|
||||
element = page.locator(f".{element_name}")
|
||||
element.wait_for()
|
||||
except PlaywrightTimeout as ex:
|
||||
except PlaywrightTimeout:
|
||||
logger.exception("Timed out requesting url %s", url)
|
||||
raise ex
|
||||
raise
|
||||
|
||||
try:
|
||||
# chart containers didn't render
|
||||
@@ -191,12 +191,12 @@ class WebDriverPlaywright(WebDriverProxy):
|
||||
slice_container_locator.first.wait_for()
|
||||
for slice_container_elem in slice_container_locator.all():
|
||||
slice_container_elem.wait_for()
|
||||
except PlaywrightTimeout as ex:
|
||||
except PlaywrightTimeout:
|
||||
logger.exception(
|
||||
"Timed out waiting for chart containers to draw at url %s",
|
||||
url,
|
||||
)
|
||||
raise ex
|
||||
raise
|
||||
try:
|
||||
# charts took too long to load
|
||||
logger.debug(
|
||||
@@ -204,11 +204,11 @@ class WebDriverPlaywright(WebDriverProxy):
|
||||
)
|
||||
for loading_element in page.locator(".loading").all():
|
||||
loading_element.wait_for(state="detached")
|
||||
except PlaywrightTimeout as ex:
|
||||
except PlaywrightTimeout:
|
||||
logger.exception(
|
||||
"Timed out waiting for charts to load at url %s", url
|
||||
)
|
||||
raise ex
|
||||
raise
|
||||
|
||||
selenium_animation_wait = current_app.config[
|
||||
"SCREENSHOT_SELENIUM_ANIMATION_WAIT"
|
||||
@@ -366,9 +366,9 @@ class WebDriverSelenium(WebDriverProxy):
|
||||
element = WebDriverWait(driver, self._screenshot_locate_wait).until(
|
||||
EC.presence_of_element_located((By.CLASS_NAME, element_name))
|
||||
)
|
||||
except TimeoutException as ex:
|
||||
except TimeoutException:
|
||||
logger.exception("Selenium timed out requesting url %s", url)
|
||||
raise ex
|
||||
raise
|
||||
|
||||
try:
|
||||
# chart containers didn't render
|
||||
@@ -378,12 +378,12 @@ class WebDriverSelenium(WebDriverProxy):
|
||||
(By.CLASS_NAME, "chart-container")
|
||||
)
|
||||
)
|
||||
except TimeoutException as ex:
|
||||
except TimeoutException:
|
||||
logger.exception(
|
||||
"Selenium timed out waiting for chart containers to draw at url %s",
|
||||
url,
|
||||
)
|
||||
raise ex
|
||||
raise
|
||||
|
||||
try:
|
||||
# charts took too long to load
|
||||
@@ -393,11 +393,11 @@ class WebDriverSelenium(WebDriverProxy):
|
||||
WebDriverWait(driver, self._screenshot_load_wait).until_not(
|
||||
EC.presence_of_all_elements_located((By.CLASS_NAME, "loading"))
|
||||
)
|
||||
except TimeoutException as ex:
|
||||
except TimeoutException:
|
||||
logger.exception(
|
||||
"Selenium timed out waiting for charts to load at url %s", url
|
||||
)
|
||||
raise ex
|
||||
raise
|
||||
|
||||
selenium_animation_wait = current_app.config[
|
||||
"SCREENSHOT_SELENIUM_ANIMATION_WAIT"
|
||||
|
||||
Reference in New Issue
Block a user