dpgaspar commented on code in PR #35063:
URL: https://github.com/apache/superset/pull/35063#discussion_r2371829428
##########
superset/utils/screenshots.py:
##########
@@ -169,7 +184,23 @@ 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
+ with _fallback_lock:
+ 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:
Don't think that the overhead of the lock, global variable, and complexity
isn't worth it for preventing some log lines. Also celery can be configured to
use forks (most frequent) or threads/eventlet etc, on the fork case that is the
most common scenario. Let's just log it, most log systems can deduplication
anyway
--
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]