From db423ee9789b3a045266665198c4b25f31a23b6f Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Mon, 25 Aug 2025 23:15:34 +0800 Subject: [PATCH] [`airflow`] replace wrong path `airflow.io.stroage` as `airflow.io.store` (`AIR311`) (#20081) ## Summary `airflow.io.storage` is not the correct path. it should be `airflow.io.store` instead --- .../resources/test/fixtures/airflow/AIR311_names.py | 2 +- .../src/rules/airflow/rules/suggested_to_update_3_0.rs | 2 +- ..._rules__airflow__tests__AIR311_AIR311_names.py.snap | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/ruff_linter/resources/test/fixtures/airflow/AIR311_names.py b/crates/ruff_linter/resources/test/fixtures/airflow/AIR311_names.py index 47c7b4270d..712957f3b1 100644 --- a/crates/ruff_linter/resources/test/fixtures/airflow/AIR311_names.py +++ b/crates/ruff_linter/resources/test/fixtures/airflow/AIR311_names.py @@ -34,7 +34,7 @@ task_group() setup() from airflow.decorators import teardown from airflow.io.path import ObjectStoragePath -from airflow.io.storage import attach +from airflow.io.store import attach from airflow.models import DAG as DAGFromModel from airflow.models import ( Connection, diff --git a/crates/ruff_linter/src/rules/airflow/rules/suggested_to_update_3_0.rs b/crates/ruff_linter/src/rules/airflow/rules/suggested_to_update_3_0.rs index b5e26ea2ab..c2c7a64fa3 100644 --- a/crates/ruff_linter/src/rules/airflow/rules/suggested_to_update_3_0.rs +++ b/crates/ruff_linter/src/rules/airflow/rules/suggested_to_update_3_0.rs @@ -233,7 +233,7 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) { module: "airflow.sdk", name: "ObjectStoragePath".to_string(), }, - ["airflow", "io", "storage", "attach"] => Replacement::SourceModuleMoved { + ["airflow", "io", "store", "attach"] => Replacement::SourceModuleMoved { module: "airflow.sdk.io", name: "attach".to_string(), }, diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap index 1477d7e535..fa121a1dce 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap @@ -312,7 +312,7 @@ help: Use `teardown` from `airflow.sdk` instead. 34 34 | setup() 35 |-from airflow.decorators import teardown 36 35 | from airflow.io.path import ObjectStoragePath -37 36 | from airflow.io.storage import attach +37 36 | from airflow.io.store import attach 38 37 | from airflow.models import DAG as DAGFromModel -------------------------------------------------------------------------------- 43 42 | from airflow.models.baseoperator import chain, chain_linear, cross_downstream @@ -338,7 +338,7 @@ help: Use `ObjectStoragePath` from `airflow.sdk` instead. 34 34 | setup() 35 35 | from airflow.decorators import teardown 36 |-from airflow.io.path import ObjectStoragePath -37 36 | from airflow.io.storage import attach +37 36 | from airflow.io.store import attach 38 37 | from airflow.models import DAG as DAGFromModel 39 38 | from airflow.models import ( -------------------------------------------------------------------------------- @@ -350,7 +350,7 @@ help: Use `ObjectStoragePath` from `airflow.sdk` instead. 47 47 | # airflow.decorators 48 48 | teardown() -AIR311 [*] `airflow.io.storage.attach` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version. +AIR311 [*] `airflow.io.store.attach` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version. --> AIR311_names.py:52:1 | 50 | # # airflow.io @@ -366,7 +366,7 @@ help: Use `attach` from `airflow.sdk.io` instead. 34 34 | setup() 35 35 | from airflow.decorators import teardown 36 36 | from airflow.io.path import ObjectStoragePath -37 |-from airflow.io.storage import attach +37 |-from airflow.io.store import attach 38 37 | from airflow.models import DAG as DAGFromModel 39 38 | from airflow.models import ( 40 39 | Connection, @@ -391,7 +391,7 @@ AIR311 [*] `airflow.models.Connection` is removed in Airflow 3.0; It still works help: Use `Connection` from `airflow.sdk` instead. ℹ Unsafe fix -37 37 | from airflow.io.storage import attach +37 37 | from airflow.io.store import attach 38 38 | from airflow.models import DAG as DAGFromModel 39 39 | from airflow.models import ( 40 |- Connection,