Skip to content

Commit 0df2a78

Browse files
authored
[ruff] Update 0.0.255 -> 0.0.277 (#14674)
## Summary & Motivation Internal companion PR: dagster-io/internal#5846 Updates ruff from 0.0.255 to 0.0.277. This introduces autofix for the TCH rule, which allows auto-sorting type-checking only imports into `TYPE_CHECKING` blocks. Because the changes resulting from enabling this rule are large, they are in an upstack PR. This PR contains only the ruff version update, a few fixes for issues surfaced by ruff behavior changes to already-enabled rules, and the new rules RUF009 and RUF010 (which are enabled because we enable the whole category of RUF* rules). - RUF009 flags function calls in field defaults for dataclasses - RUF010 converts e.g. this: `f"foo {repr(some_var)}"` to the more idiomatic `f"foo {some_var!r}"` using [f-string conversion flags](https://peps.python.org/pep-0498/#specification). ## How I Tested These Changes ruff
1 parent cbadd60 commit 0df2a78

File tree

153 files changed

+228
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+228
-203
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ repos:
1717
name: black-jupyter [docs-snippets]
1818
files: "^examples/docs_snippets/.*.py"
1919
- repo: https://github.com/charliermarsh/ruff-pre-commit
20-
rev: v0.0.255
20+
rev: v0.0.277
2121
hooks:
2222
- id: ruff

docs/content/concepts/partitions-schedules-sensors/sensors.mdx

Lines changed: 2 additions & 2 deletions

docs/content/guides/dagster/dagster_type_factories.mdx

Lines changed: 2 additions & 2 deletions

docs/content/integrations/bigquery/reference.mdx

Lines changed: 0 additions & 1 deletion

docs/content/integrations/duckdb/reference.mdx

Lines changed: 0 additions & 1 deletion

docs/content/integrations/snowflake/reference.mdx

Lines changed: 0 additions & 1 deletion

docs/sphinx/_ext/autodoc_dagster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def config_field_to_lines(field, name=None) -> List[str]:
103103
lines.append(" " * 12 + ln)
104104
else:
105105
lines.append("")
106-
lines.append(f" **Default Value:** {repr(val)}")
106+
lines.append(f" **Default Value:** {val!r}")
107107

108108
# if field has subfields, recurse
109109
if hasattr(field.config_type, "fields") and len(field.config_type.fields) > 0:

examples/assets_dynamic_partitions/assets_dynamic_partitions_tests/test_release_sensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import os
33
from unittest.mock import MagicMock, patch
44

5-
from assets_dynamic_partitions.release_sensor import release_sensor
65
from dagster import DagsterInstance, SkipReason, build_sensor_context
76

7+
from assets_dynamic_partitions.release_sensor import release_sensor
8+
89

910
def test_release_sensor_no_new_releases():
1011
old_environ = dict(os.environ)

examples/assets_pandas_pyspark/assets_pandas_pyspark_tests/test_assets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from assets_pandas_pyspark.assets import spark_asset, table_assets
21
from dagster import load_assets_from_modules, materialize
32
from dagster._core.test_utils import instance_for_test
43

4+
from assets_pandas_pyspark.assets import spark_asset, table_assets
5+
56

67
def test_weather_assets():
78
from assets_pandas_pyspark.local_filesystem_io_manager import LocalFileSystemIOManager

examples/assets_pandas_type_metadata/assets_pandas_type_metadata_tests/test_bollinger_analysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
from dagster import AssetSelection, define_asset_job, with_resources
2+
13
from assets_pandas_type_metadata.assets.bollinger_analysis import (
24
sp500_anomalous_events,
35
sp500_bollinger_bands,
46
sp500_prices,
57
)
68
from assets_pandas_type_metadata.resources.csv_io_manager import LocalCsvIOManager
7-
from dagster import AssetSelection, define_asset_job, with_resources
89

910

1011
def test_bollinger_analysis():

0 commit comments

Comments
 (0)