From 7cc517dac87076b33f2c04c3538f1a7a363b3b17 Mon Sep 17 00:00:00 2001 From: gnought <1684105+gnought@users.noreply.github.com> Date: Wed, 15 Nov 2023 09:41:03 +0800 Subject: [PATCH] chore: add type hints --- superset/utils/webdriver.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/superset/utils/webdriver.py b/superset/utils/webdriver.py index 0987f07d9dc37..365bbb7278318 100644 --- a/superset/utils/webdriver.py +++ b/superset/utils/webdriver.py @@ -33,6 +33,7 @@ ) from selenium.webdriver import chrome, firefox, FirefoxProfile from selenium.webdriver.common.by import By +from selenium.webdriver.common.service import Service from selenium.webdriver.remote.webdriver import WebDriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait @@ -248,8 +249,8 @@ class WebDriverSelenium(WebDriverProxy): def create(self) -> WebDriver: pixel_density = current_app.config["WEBDRIVER_WINDOW"].get("pixel_density", 1) if self._driver_type == "firefox": - driver_class = firefox.webdriver.WebDriver - service_class = firefox.service.Service + driver_class: type[WebDriver] = firefox.webdriver.WebDriver + service_class: type[Service] = firefox.service.Service options = firefox.options.Options() profile = FirefoxProfile() profile.set_preference("layout.css.devPixelsPerPx", str(pixel_density)) @@ -268,7 +269,7 @@ def create(self) -> WebDriver: ) # Prepare args for the webdriver init - for arg in current_app.config["WEBDRIVER_OPTION_ARGS"]: + for arg in list(current_app.config["WEBDRIVER_OPTION_ARGS"]): options.add_argument(arg) # Add additional configured webdriver options