From 6b4ab27f01d6b35c8f7c54fd24250f89b0cd1f21 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Wed, 22 Apr 2026 12:35:42 -0700 Subject: [PATCH] address review: replace assert in _auth with explicit RuntimeError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assertions can be disabled at runtime, so use an explicit check and raise instead — matches how driver creation failure is already handled. Co-Authored-By: Claude Opus 4.7 --- superset/utils/webdriver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/utils/webdriver.py b/superset/utils/webdriver.py index 6792dbdb1ab..32e2c568b87 100644 --- a/superset/utils/webdriver.py +++ b/superset/utils/webdriver.py @@ -561,7 +561,8 @@ class WebDriverSelenium(WebDriverProxy): def _auth(self, user: User) -> None: """Authenticate the persistent driver in-place.""" - assert self._driver is not None + if self._driver is None: + raise RuntimeError("WebDriver is not initialized") machine_auth_provider_factory.instance.authenticate_webdriver( self._driver, user )