Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions superset/utils/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from selenium.webdriver.support import expected_conditions as EC # noqa: N812
from selenium.webdriver.support.ui import WebDriverWait

from superset import feature_flag_manager
from superset.extensions import machine_auth_provider_factory
from superset.utils.retries import retry_call
from superset.utils.screenshot_utils import take_tiled_screenshot
Expand All @@ -47,9 +46,11 @@
logger = logging.getLogger(__name__)

if TYPE_CHECKING:
from typing import Any

from flask_appbuilder.security.sqla.models import User

if feature_flag_manager.is_feature_enabled("PLAYWRIGHT_REPORTS_AND_THUMBNAILS"):
try:
from playwright.sync_api import (
BrowserContext,
Error as PlaywrightError,
Expand All @@ -58,6 +59,16 @@
sync_playwright,
TimeoutError as PlaywrightTimeout,
)
except ImportError:
from typing import Any

# Define dummy classes when playwright is not available
BrowserContext = Any
PlaywrightError = Exception
PlaywrightTimeout = Exception
Locator = Any
Page = Any
sync_playwright = None


class DashboardStandaloneMode(Enum):
Expand Down
Loading