From 68d2466832337fd7ce7f7161ef811877120c20f4 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Tue, 31 Dec 2024 17:28:11 +0900 Subject: [PATCH] [`airflow`] Remove additional spaces (`AIR302`) (#15211) ## Summary During https://github.com/astral-sh/ruff/pull/15209, additional spaces was accidentally added to the rule `airflow.operators.latest_only.LatestOnlyOperator`. This PR fixes this issue ## Test Plan A test fixture has been included for the rule. --- crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs | 2 +- ...f_linter__rules__airflow__tests__AIR302_AIR302_names.py.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs b/crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs index 326fe3ad66..3c35a64d86 100644 --- a/crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs +++ b/crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs @@ -513,7 +513,7 @@ fn check_name(checker: &mut Checker, expr: &Expr, range: TextRange) { Replacement::Name("airflow.operators.python.ShortCircuitOperator") } ["airflow", "operators", "latest_only_operator", "LatestOnlyOperator"] => { - Replacement::Name(" airflow.operators.latest_only.LatestOnlyOperator") + Replacement::Name("airflow.operators.latest_only.LatestOnlyOperator") } // airflow.sensors diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_names.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_names.py.snap index 0b9980d549..03104f2eee 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_names.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_names.py.snap @@ -555,7 +555,7 @@ AIR302_names.py:183:1: AIR302 `airflow.operators.latest_only_operator.LatestOnly 184 | 185 | # airflow.operators.python_operator | - = help: Use ` airflow.operators.latest_only.LatestOnlyOperator` instead + = help: Use `airflow.operators.latest_only.LatestOnlyOperator` instead AIR302_names.py:186:1: AIR302 `airflow.operators.python_operator.BranchPythonOperator` is removed in Airflow 3.0 |