Claude Code
dfd3f7b316
ci(lint): enforce no function-body imports (PLC0415) with targeted ignores
...
Follow-up to #40231 (merged), where a reviewer flagged a function-body
`from datetime import datetime, timedelta` instead of a top-of-file
import. Adds a `ruff-import-placement` pre-commit hook running
`ruff check --select PLC0415 --preview --no-fix`.
Per @rusackas's pushback on the first cut of this PR — which spammed
2,657 `# noqa: PLC0415` annotations across ~410 files without fixing
anything — this revision is a much smaller surface area:
1. **Per-file-ignores** for whole directories where function-body
imports are a deliberate pattern, not an oversight:
- `superset/cli/**` and `scripts/**`: subcommand-deferred imports
keep heavy modules out of the CLI startup path.
- `superset/tasks/**`: Celery task bodies defer imports of the
modules they orchestrate.
- `superset/migrations/versions/**`: Alembic migrations interact
with model state at runtime, not at module load.
- `superset/mcp_service/**`: MCP tools lazy-load resources on
invocation so the server can register many tools without paying
their import cost at startup.
- `superset/db_engine_specs/**`: engine specs defer driver imports
so optional DB drivers don't have to be installed.
- `superset/initialization/__init__.py`, `superset/extensions/__init__.py`,
`superset/app.py`: the app-factory and extension wiring are
intentionally full of circular-import workarounds.
- `tests/**`: test files routinely defer imports for fixture
isolation; the rule still applies to production code.
2. **Per-line `# noqa: PLC0415`** on the 259 remaining genuine
circular-import sites (security/manager.py, sql/execution/executor.py,
semantic_layers/labels.py, tags/core.py, core_api_injection.py, etc.).
These are foundational modules where moving the imports up would
actually break things.
Net result: ~410 files / 2,657 grandfathered → ~73 files / 259 actual
noqa annotations. The rule still catches every new function-body
import outside the explicitly-allowed directories.
Also: silences a pre-existing C901 on `mcp_service/sql_lab/tool/execute_sql.py`
that fires under newer local ruff but not CI's pinned ruff 0.9.7 — blocks
the local pre-commit run otherwise.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 13:55:14 -07:00
Elizabeth Thompson
8d2b655c22
fix(reports): narrow spinner checks to viewport and tighten exception handling ( #39895 )
...
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-15 13:35:07 -07:00
Elizabeth Thompson
f0d521dfc2
fix(reports): poll for spinner absence instead of snapshotting loading elements ( #39579 )
...
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-23 22:03:43 -03:00
Elizabeth Thompson
587fe4af63
fix(reports): propagate PlaywrightTimeout so execution transitions to ERROR state ( #39176 )
...
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-08 11:00:03 -07:00
Antonio Rivero
20cc3345d8
chore(playwright): Using warning for timeouts ( #38441 )
2026-03-05 14:15:10 +01:00
Amin Ghadersohi
985c3d12a1
fix(screenshots): downgrade screenshot timeout logs from ERROR to WARNING ( #38130 )
...
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-02 10:03:07 +01:00
Kamil Gabryjelski
f3407d7a56
chore: Close playwright browser gracefully ( #36537 )
2025-12-18 17:30:22 +01:00
Kamil Gabryjelski
63dfd95aa2
fix: Flakiness around scrolling during taking tiled screenshots with Playwright ( #36051 )
2025-11-10 12:57:28 +01:00
Erkka Tahvanainen
d089a96163
fix(playwright): Download dashboard correctly ( #35484 )
...
Co-authored-by: Erkka Tahvanainen <erkka.tahvanainen@confidently.fi >
2025-10-20 16:57:01 +02:00
Amin Ghadersohi
77c3146829
fix(webdriver): add missing options object to WebDriver initialization ( #35504 )
2025-10-06 10:23:13 -07:00
Amin Ghadersohi
fe7f8062f3
fix: Enable Playwright migration with graceful Selenium fallback ( #35063 )
...
Co-authored-by: Claude <noreply@anthropic.com >
2025-09-23 10:47:45 -07:00
Maxime Beauchemin
088ecdd0bf
refactor: Enable G logging rules and comprehensive ruff improvements ( #35081 )
...
Co-authored-by: Claude <noreply@anthropic.com >
2025-09-15 12:42:49 -07:00
Elizabeth Thompson
385471c34d
fix(utils): ensure webdriver timeout compatibility with urllib3 2.x ( #34440 )
2025-09-05 16:25:15 -07:00
Daniel Vaz Gaspar
b2f8803486
fix: playwright feature flag evaluation ( #34978 )
2025-09-02 10:44:22 -07:00
Kamil Gabryjelski
57d0e78d40
feat: Tiled screenshots in Playwright reports ( #34561 )
2025-08-12 08:09:01 +02:00
Maxime Beauchemin
cb27d5fe8d
chore: proper current_app.config proxy usage ( #34345 )
...
Co-authored-by: Claude <noreply@anthropic.com >
2025-07-31 19:27:42 -07:00
Mehmet Salih Yavuz
f756cee01b
fix(theming): Remove leftover antd5 prefix ( #34188 )
2025-07-16 19:31:14 +03:00
Daniel Höxtermann
2233c02720
fix(playwright): allow screenshotting empty dashboards ( #33107 )
2025-04-14 12:20:39 -07:00
Michael S. Molina
e1f5c49df7
fix: Allows configuration of Selenium Webdriver binary ( #33103 )
2025-04-14 08:11:02 -03:00
Jack
7db0589340
fix(thumbnail cache): Enabling force parameter on screenshot/thumbnail cache ( #31757 )
...
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com >
2025-01-31 19:22:31 +01:00
Gnought
44ff462718
chore(deps): bump selenium 4.14.0+ ( #25933 )
...
Co-authored-by: Evan Rusackas <evan@rusackas.com >
2025-01-13 14:52:29 -07:00
alexandrusoare
f362c6f508
refactor(Modal): Upgrade Modal component to Antd5 ( #31420 )
...
Co-authored-by: Diego Pucci <diegopucci.me@gmail.com >
2024-12-19 17:22:11 +01:00
Maxime Beauchemin
e51b95ffa8
chore: enforce more ruff rules ( #31447 )
...
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com >
2024-12-18 17:41:34 -08:00
Mehmet Salih Yavuz
58f9be9b85
fix(empty dashboards): Allow downloading a screenshot of an empty dashboard ( #30767 )
...
Co-authored-by: Geido <60598000+geido@users.noreply.github.com >
2024-11-13 16:16:33 +04:00
Maxime Beauchemin
4bb2e2f8af
chore: enable ruff lint rule TRY201 and B904 to improve raise stack traces ( #29166 )
2024-06-12 13:04:42 -07:00
Vitor Avila
020c79970f
fix(reports): Update the element class to wait for when taking a screenshot ( #28745 )
2024-05-29 13:05:48 -06:00
Maxime Beauchemin
2d63722150
chore: set up ruff as a new linter/formatter ( #28158 )
2024-04-24 17:19:53 -07:00
Kamil Gabryjelski
3f9183a162
chore: Use WEBDRIVER_OPTION_ARGS with Playwright ( #26315 )
2023-12-20 12:42:12 +01:00
Kamil Gabryjelski
dbed64a2c6
fix: Use page.locator in Playwright reports ( #26224 )
2023-12-08 17:16:13 +01:00
Kamil Gabryjelski
bda43ac0f6
chore: Add config options for Playwright wait_until and default timeout ( #25765 )
2023-10-27 10:37:32 +02:00
Kamil Gabryjelski
ff95d0face
feat: Implement using Playwright for taking screenshots in reports ( #25247 )
2023-10-04 06:51:58 +02:00
Josh Soref
0735680674
chore(backend): Spelling ( #25457 )
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-09-29 09:36:50 -07:00
EugeneTorap
fc89718d48
chore: Update pylint to 2.17.4 ( #24700 )
...
Co-authored-by: John Bodley <john.bodley@gmail.com >
2023-07-24 17:13:49 -07:00
John Bodley
a4d5d7c6b9
chore(pre-commit): Add pyupgrade and pycln hooks ( #24197 )
2023-06-01 12:01:10 -07:00
Elizabeth Thompson
989fe27a0f
chore: log different selenium timeout errors differently ( #23290 )
2023-03-09 12:55:12 -08:00
Craig Rueda
d3e698eb54
chore(webdriver): Tuning the Webdriver logging a bit ( #23255 )
2023-03-01 11:46:49 -08:00
Elizabeth Thompson
4ddf67fc14
chore: move dashboard screenshot standalone logic ( #23003 )
2023-02-15 14:35:08 -08:00
Elizabeth Thompson
0a2fc9cdde
fix: change order of webdriver timeout checks ( #22698 )
2023-01-17 10:00:51 -08:00
Rui Zhao
d1989a4766
fix(report): Capture unexpected errors in report screenshots. Fixes #21653 ( #21724 )
...
Co-authored-by: Rui Zhao <zhaorui@dropbox.com >
2022-12-13 14:31:36 -07:00
Ville Brofeldt
a02a778cc3
feat(reports): execute as other than selenium user ( #21931 )
...
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com >
2022-10-31 14:32:49 +02:00
Hugh A. Miles II
2263a76f4d
remove eleement reference ( #20830 )
2022-07-22 13:56:33 -04:00
Beto Dealmeida
b7707e8ff7
feat: bypass cache on screenshots for alerts ( #17695 )
...
* feat: bypass cache on screenshots for alerts
* Update existing tests
* Add backend test
* Add frontend test
2021-12-22 08:26:38 -08:00
Elizabeth Thompson
3ee9e11ce1
feat: add a config to enable retina quality images in screenshots ( #17409 )
...
* add feature flag for retina screenshot support
* use config for pixel density
* run black
2021-11-15 12:47:40 -08:00
Beto Dealmeida
a74352644e
fix: typo in log ( #16767 )
2021-09-21 19:54:38 -04:00
Grace Guo
00ca21e016
fix: report with timeout chart ( #16674 )
2021-09-15 11:09:21 -07:00
John Bodley
0df15bf207
chore(pylint): Reenable import-outside-toplevel check ( #16263 )
...
Co-authored-by: John Bodley <john.bodley@airbnb.com >
2021-08-17 05:20:13 +12:00
Hugh A. Miles II
4cb79e5017
fix: Fix long dashboards screenshot emails ( #15954 )
...
* create serialize json function
* create new setting for reports
* cleanup
* address comments
* up the attributes
2021-08-02 16:37:34 -04:00
Beto Dealmeida
c9dad05f2b
chore: remove retry dependency in favor of backoff ( #15788 )
...
* chore: remove retry dep in favor of backoff
* Fix lint
2021-07-20 10:33:37 -07:00
u-aiaa
6b790990a8
fix: Add waiting time for chart animation when screenshot ( #15610 )
2021-07-15 18:25:48 -07:00
Daniel Vaz Gaspar
f52b6715cf
fix: downgrade selenium log level on timeout ( #15328 )
2021-06-28 20:02:05 +01:00