Addresses bot review comments:
- Add public create() and destroy() methods for WebDriverSelenium
(fixes tests calling removed public method)
- Fix user session handling - re-authenticate if different user passed
- Change exception handling from URLError to WebDriverException
- Use wd.destroy() for proper WebDriver cleanup instead of del
- Fix N+1 query in DummyStrategy with selectinload for dashboard.slices
- Fix docs: config.py -> superset_config.py and add crontab import
- Fix tests: use get_url_host() instead of hardcoded localhost
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This PR adopts and improves PR #20387 by @ensky to fix cache warmup issues
where the task was unable to authenticate properly.
Changes:
- Use WebDriver (Selenium) to render dashboards for cache warmup instead of
API calls, ensuring proper authentication and accurate cache population
- Add SUPERSET_CACHE_WARMUP_USER config for specifying the warmup user
- Refine WebDriverSelenium to support persistent driver instances,
avoiding driver recreation for each URL
- Warm up entire dashboards instead of individual charts, since dashboard
context affects how charts are cached
- Add documentation for Celery beat configuration
The WebDriver approach simulates real user behavior, ensuring caches are
populated exactly as users would experience them.
Fixes#9597, #18933
Originally by @ensky in PR #20387
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update db setup fixture scope
* Load data into db only once
* Update fixture scopes for data loading
* cleanup imports
* try import
* Update scope
* fix cleanup
* Import all fixtures
* Separate data log and metadata creation
* Retain table description
* fix dtype
Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>