aminghadersohi commented on code in PR #35063:
URL: https://github.com/apache/superset/pull/35063#discussion_r2369802137


##########
superset/utils/screenshots.py:
##########
@@ -169,7 +182,22 @@ def __init__(self, url: str, digest: str | None):
     def driver(self, window_size: WindowSize | None = None) -> WebDriver:
         window_size = window_size or self.window_size
         if 
feature_flag_manager.is_feature_enabled("PLAYWRIGHT_REPORTS_AND_THUMBNAILS"):
-            return WebDriverPlaywright(self.driver_type, window_size)
+            # Try to use Playwright if available (supports WebGL/DeckGL, 
unlike Cypress)
+            if PLAYWRIGHT_AVAILABLE:
+                return WebDriverPlaywright(self.driver_type, window_size)
+
+            # Log fallback only once to avoid log spam on repeated operations
+            global _PLAYWRIGHT_FALLBACK_LOGGED
+            if not _PLAYWRIGHT_FALLBACK_LOGGED:
+                logger.info(
+                    "PLAYWRIGHT_REPORTS_AND_THUMBNAILS enabled but Playwright 
not "
+                    "installed. Falling back to Selenium (WebGL/Canvas charts 
may "
+                    "not render correctly). %s",
+                    PLAYWRIGHT_INSTALL_MESSAGE,
+                )
+                _PLAYWRIGHT_FALLBACK_LOGGED = True

Review Comment:
   You're right about the concurrency issues. Added thread safety with a lock 
to  prevent race conditions in threaded Flask mode. The per-process behavior in 
Celery is actually fine (one log per worker), but the threading needed fixing.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to