sadpandajoe opened a new pull request, #45239: URL: https://github.com/apache/superset/pull/45239
### SUMMARY Two independent nightly full-repo pre-commit failures ([run 38356808963](https://github.com/apache/superset/actions/runs/38356808963), at master `1578b8cbc1`), each with a cited root cause. **mypy (main).** `tests/unit_tests/semantic_layers/metric_filter_test.py:248` iterated `query.filters` without narrowing away `None` first. `SemanticQuery.filters` is declared `set[Filter] | None` in `superset-core/src/superset_core/semantic_layers/types.py:234`, so the set comprehension is a `union-attr` error. It is invisible to scoped per-PR runs because `pyproject.toml` sets `follow_imports = "skip"` for `superset_core.*`; the real declaration is only resolved when superset-core's own source is an explicit target of the same mypy invocation, which happens in the nightly whole-repo run. Fixed with `assert query.filters is not None`, the idiom already used elsewhere in this file. **oxfmt (frontend).** #45225 (dependabot) bumped oxfmt 0.71.0 → 0.72.0 in `superset-frontend/package.json`. 0.72.0 formats arrow functions whose body is a tagged `css` template differently, so `Typography/index.tsx` and `VizTypeGallery.tsx` — last formatted under 0.71.0 — were flagged as drifted. Re-ran `oxfmt --write` on exactly those two files. In `VizTypeGallery.tsx` an explanatory comment also moved from between the arrow and the template to its own line above the `css` prop, so the formatter collapses the arrow to the single-line form used by the rest of the frontend (matching the existing style already in this file). No behavior change in either file: the Python edit is a test-only assertion, and the two frontend edits are formatting and comment placement. The same run reported five other mypy errors (`superset/semantic_layers/mapper.py:427`, `superset/daos/datasource.py:121`, `superset/commands/security/reset.py:82` ×2, `tests/unit_tests/commands/deletion_retention/test_purge_chart_detach.py:203`). Those are already addressed on open PRs #45138 and #45185 and are deliberately untouched here. Fixes #45238 ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF ### TESTING INSTRUCTIONS 1. `pre-commit run mypy --all-files` (or `mypy --check-untyped-defs tests/unit_tests/semantic_layers/metric_filter_test.py superset-core/src/superset_core/semantic_layers/types.py`). The `metric_filter_test.py:248` `union-attr` error is gone; delete the new `assert` line and re-run to see it return. 2. From `superset-frontend/`: `npx oxfmt --check -- packages/superset-ui-core/src/components/Typography/index.tsx src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx` — reports all files correctly formatted. Check out master's version of either file and re-run to see it fail. 3. Open Explore and click **View all charts** to confirm the viz-type gallery's left pane renders unchanged, with the "All charts" and "Featured" selectors keeping their margins. ### ADDITIONAL INFORMATION - [x] Has associated issue: Fixes #45238 - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
