You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/04/07 21:13:36 UTC
Re: [PR] fix: cache warmup using WebDriver for reliable authentication [superset]
rusackas commented on code in PR #38449:
URL: https://github.com/apache/superset/pull/38449#discussion_r3047899054
##########
superset/utils/webdriver.py:
##########
@@ -516,25 +558,27 @@ def create(self) -> WebDriver:
logger.debug("Init selenium driver")
return driver_class(**kwargs)
- def auth(self, user: User) -> WebDriver:
- driver = self.create()
+ def _auth(self, user: User) -> WebDriver:
+ driver = self._create()
return machine_auth_provider_factory.instance.authenticate_webdriver(
driver, user
)
Review Comment:
Fixed in 776ab3cb14. _auth() now authenticates self._driver in-place rather than calling _create() for a second driver whose return value was immediately discarded, leaving self._driver unauthenticated. Method signature changed to void to make clear it mutates state.
##########
superset/utils/webdriver.py:
##########
@@ -399,6 +402,29 @@ def get_screenshot( # pylint: disable=too-many-locals, too-many-statements # n
class WebDriverSelenium(WebDriverProxy):
+ def __init__(
+ self,
+ driver_type: str,
+ window: WindowSize | None = None,
+ user: User | None = None,
+ ):
+ super().__init__(driver_type, window)
+ self._user = user
+ self._driver: WebDriver | None = None
+
+ def __del__(self) -> None:
+ self._destroy()
+
+ @property
+ def driver(self) -> WebDriver:
+ if not self._driver:
+ self._driver = self._create()
+ assert self._driver # for mypy
+ self._driver.set_window_size(*self._window)
Review Comment:
Fixed in 776ab3cb14. Replaced the assert with an explicit RuntimeError check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org