Commit d5e6340
chore(ruff): bump ruff to 0.16.2 and clear surfaced lint (#26359)
## Summary & Motivation
Bumps `ruff` from `0.15.15` to `0.16.2` and clears the lint/format diff
the new version surfaces. This is a bigger bump than usual because
0.16.0 made two significant default-behavior changes: the default lint
rule set expanded from 59 to 413 rules, and the formatter now formats
Python code blocks in Markdown files.
## Pin sites and lockfiles
All six pin sites updated: root `pyproject.toml`,
`dagster-oss/python_modules/dagster/pyproject.toml` (×2: `test` and
`ruff` extras), `python_modules/purina/pyproject.toml`,
`public/skills/dagster-skills-evals/pyproject.toml`, and
`required-version` in `dagster-oss/config/ruff.toml`.
Beyond the usual two lockfiles (root `uv.lock` via `just
rebuild_uv_lock_file`, dagster's via `update_lockfiles.py`), seven more
dagster-oss lockfiles pinned the old ruff through their path dependency
on dagster's extras and were relocked with `update_lockfiles.py`:
`docs`, `examples/docs_snippets`, `examples/with_great_expectations`,
`examples/assets_pandas_type_metadata`,
`examples/docs_projects/project_components_pdf_extraction`,
`libraries/dagster-ge`, and `libraries/dagster-dg-cli`. These would
otherwise fail lockfile-staleness checks in CI.
## Lint changes
`just ruff` at 0.16.2 found 178 diagnostics; 108 auto-fixed at default
safety and 48 more with `--unsafe-fixes`. The autofix diff is dominated
by RUF036 (`None` moved to the end of unions, newly stabilized) plus
assorted comprehension cleanups, stale-`noqa` removals, and typing
modernization. One explanatory comment dropped by the union-reordering
fix in `dagster_shared/serdes/serdes.py` was restored by hand.
Hand fixes for the non-autofixable residue:
- **UP035** in `_core/types/{config_schema,dagster_type,decorator}.py`:
replaced deprecated `typing.AbstractSet` with `collections.abc.Set as
AbstractSet` (existing repo convention) and `typing.Type` with builtin
`type`.
- **B020/PLR1704** in `_core/types/python_dict.py`: renamed a loop
variable that shadowed the `value` argument it iterates.
- **DTZ005** in `project_multi_tenant` schedules and the
`databricks-delta` lakehouse component: `datetime.now()` →
`datetime.now(timezone.utc)` (demo-data timestamps and schedule-tag
fallbacks are now tz-aware).
Config-level ignores where the newly-defaulted rules are wrong for the
context:
- `project_dspy`: `BLE001` (example code deliberately catches broad
exceptions when scoring LLM output) and `RUF012` (same class-attribute
false-positive class the shared config ignores globally). These files
are embedded in docs via snippet markers, so `noqa` comments would leak
into rendered docs.
- `dagster-skills-evals`: `PLR0917` (too-many-positional-arguments,
newly stabilized) alongside the existing `PLR0913` ignore — typer CLI
commands legitimately take many parameters.
- `project_multi_tenant`: `UP017` — the project targets py311 so ruff
wants `datetime.UTC`, but the ty master env type-checks examples at
Python 3.10 (dagster's minimum) where that symbol doesn't exist.
## Markdown formatting
102 `.md` files had their Python code fences reformatted (~1,700 lines)
by the new default Markdown formatting. Kept rather than excluded via
`format.exclude`: CI's `ruff format --check` enforces it, and the repo
precedent (0.15.0 bump) was to adopt new formatter defaults wholesale.
Spot-checked the largest diffs (`MIGRATION.md`, `CHANGES.md`, docs
guides) — all benign style normalization inside valid-Python fences.
## Test Plan
- [x] `just ruff` clean (`All checks passed!`, formatter no-op on second
run).
- [x] `just ty` clean (`Found 0 errors / Found 0 warnings`, 7257 files)
across all three ty environments — confirms the unsafe-fix import
deletions and the `typing.AbstractSet`/`typing.Type` replacements don't
break annotation resolution.
- [x] `rg` confirms no lockfile anywhere still references
`ruff==0.15.15`.
Internal-RevId: 56253058f2358df14a7a0ea4345dbf4eca23f75c1 parent 4ced10d commit d5e6340
116 files changed
Lines changed: 869 additions & 830 deletions
File tree
- .claude
- config
- docs
- docs
- about/contributing-docs
- api
- deployment
- dagster-plus/hybrid
- amazon-ecs
- kubernetes
- execution
- oss/deployment-options
- kubernetes
- troubleshooting
- examples
- best-practices
- full-pipelines/llm-fine-tuning
- guides
- automate
- schedules
- sensors
- build
- assets
- asset-selection-syntax
- metadata-and-tags
- components
- building-pipelines-with-components
- creating-new-components
- observe/insights
- operate/configuration
- integrations
- external-pipelines
- libraries
- airbyte
- databricks
- dlt
- gcp/bigquery
- hightouch
- jupyter
- polars
- teradata
- migration
- airflow-to-dagster
- examples
- assets_pandas_type_metadata
- docs_projects
- project_components_pdf_extraction
- project_dspy
- dspy_modules
- src/project_dspy/components
- project_multi_workspace_databricks/src/project_multi_workspace_databricks
- components
- docs_snippets
- docs_snippets/migration/from_step_launchers_to_pipes
- project_databricks_and_snowflake/projects/databricks-delta/src/databricks_delta/defs/components/lakehouse
- project_multi_tenant
- beacon_hq
- assets
- harbor_outfitters
- assets
- summit_financial
- assets
- tests
- snowflake_cortex/dagster_snowflake
- use_case_repository/use_case_repository/guides
- with_great_expectations
- integration_tests/test_suites/backcompat-test-suite
- python_modules
- automation/automation/dagster_dev
- dagster-webserver/dagster_webserver
- dagster
- dagster
- _core
- definitions
- assets
- definition
- job
- types
- _daemon
- _scheduler
- components/component
- libraries
- dagster-dg-cli
- dagster_dg_cli/cli/scaffold/branch/prompts
- dagster-ge
- dagster-hightouch
- dagster-rest-resources
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| 164 | + | |
160 | 165 | | |
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
| 180 | + | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
| |||
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
| 197 | + | |
190 | 198 | | |
191 | 199 | | |
192 | 200 | | |
| |||
330 | 338 | | |
331 | 339 | | |
332 | 340 | | |
333 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
334 | 344 | | |
335 | 345 | | |
336 | 346 | | |
| 347 | + | |
337 | 348 | | |
338 | 349 | | |
339 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
340 | 353 | | |
341 | 354 | | |
342 | 355 | | |
| |||
457 | 470 | | |
458 | 471 | | |
459 | 472 | | |
| 473 | + | |
460 | 474 | | |
461 | 475 | | |
462 | 476 | | |
463 | 477 | | |
464 | 478 | | |
| 479 | + | |
465 | 480 | | |
466 | 481 | | |
467 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1247 | 1247 | | |
1248 | 1248 | | |
1249 | 1249 | | |
1250 | | - | |
| 1250 | + | |
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
| |||
3148 | 3148 | | |
3149 | 3149 | | |
3150 | 3150 | | |
| 3151 | + | |
3151 | 3152 | | |
3152 | 3153 | | |
3153 | 3154 | | |
3154 | | - | |
| 3155 | + | |
| 3156 | + | |
3155 | 3157 | | |
3156 | 3158 | | |
3157 | 3159 | | |
| |||
4855 | 4857 | | |
4856 | 4858 | | |
4857 | 4859 | | |
4858 | | - | |
4859 | | - | |
| 4860 | + | |
| 4861 | + | |
4860 | 4862 | | |
4861 | 4863 | | |
4862 | 4864 | | |
| |||
4870 | 4872 | | |
4871 | 4873 | | |
4872 | 4874 | | |
4873 | | - | |
4874 | | - | |
| 4875 | + | |
| 4876 | + | |
4875 | 4877 | | |
4876 | 4878 | | |
4877 | 4879 | | |
4878 | | - | |
4879 | | - | |
| 4880 | + | |
4880 | 4881 | | |
4881 | 4882 | | |
4882 | 4883 | | |
| |||
5078 | 5079 | | |
5079 | 5080 | | |
5080 | 5081 | | |
5081 | | - | |
5082 | | - | |
| 5082 | + | |
5083 | 5083 | | |
5084 | 5084 | | |
5085 | 5085 | | |
| |||
5453 | 5453 | | |
5454 | 5454 | | |
5455 | 5455 | | |
5456 | | - | |
5457 | | - | |
5458 | | - | |
| 5456 | + | |
5459 | 5457 | | |
5460 | 5458 | | |
5461 | 5459 | | |
| |||
5663 | 5661 | | |
5664 | 5662 | | |
5665 | 5663 | | |
| 5664 | + | |
5666 | 5665 | | |
5667 | 5666 | | |
5668 | 5667 | | |
5669 | 5668 | | |
| 5669 | + | |
5670 | 5670 | | |
5671 | 5671 | | |
5672 | 5672 | | |
| 5673 | + | |
5673 | 5674 | | |
5674 | 5675 | | |
5675 | 5676 | | |
| |||
6230 | 6231 | | |
6231 | 6232 | | |
6232 | 6233 | | |
| 6234 | + | |
6233 | 6235 | | |
6234 | 6236 | | |
6235 | 6237 | | |
6236 | 6238 | | |
| 6239 | + | |
6237 | 6240 | | |
6238 | 6241 | | |
6239 | 6242 | | |
| |||
6608 | 6611 | | |
6609 | 6612 | | |
6610 | 6613 | | |
| 6614 | + | |
6611 | 6615 | | |
6612 | | - | |
6613 | | - | |
| 6616 | + | |
| 6617 | + | |
6614 | 6618 | | |
6615 | 6619 | | |
6616 | | - | |
6617 | | - | |
| 6620 | + | |
| 6621 | + | |
6618 | 6622 | | |
6619 | 6623 | | |
6620 | 6624 | | |
| |||
0 commit comments