From 581b7005dcf1960bdcfd642fa7409d8879254f65 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Mon, 24 Mar 2025 23:36:33 +0800 Subject: [PATCH] [airflow] refactor: combine similar case condition (AIR302) (#16944) ## Summary combine similar case condition in AIR302 ## Test Plan nothing should be changed. existing test case should already cover it --- .../src/rules/airflow/rules/removal_in_3.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 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 edbb7d5870..6bfa03aede 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 @@ -241,21 +241,9 @@ fn check_call_arguments(checker: &Checker, qualified_name: &QualifiedName, argum Some("logical_date"), )); } - ["airflow", .., "operators", "datetime", "BranchDateTimeOperator"] => { - checker.report_diagnostics(diagnostic_for_argument( - arguments, - "use_task_execution_day", - Some("use_task_logical_date"), - )); - } - ["airflow", .., "operators", "weekday", "DayOfWeekSensor"] => { - checker.report_diagnostics(diagnostic_for_argument( - arguments, - "use_task_execution_day", - Some("use_task_logical_date"), - )); - } - ["airflow", .., "operators", "weekday", "BranchDayOfWeekOperator"] => { + ["airflow", .., "operators", "datetime", "BranchDateTimeOperator"] + | ["airflow", .., "operators", "weekday", "DayOfWeekSensor" | "BranchDayOfWeekOperator"] => + { checker.report_diagnostics(diagnostic_for_argument( arguments, "use_task_execution_day",