[airflow] Add fix to remove deprecated keyword arguments (AIR302) (#14887)
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions

## Summary

Add replacement fixes to deprecated arguments of a DAG.

Ref #14582 #14626

## Test Plan

Diff was verified and snapshots were updated.

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
This commit is contained in:
Karthikeyan Singaravelan 2024-12-10 18:49:28 +05:30 committed by GitHub
parent 15fe540251
commit dc0d944608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 207 additions and 56 deletions

View file

@ -1,4 +1,4 @@
use ruff_diagnostics::{Diagnostic, Violation};
use ruff_diagnostics::{Diagnostic, Edit, Fix, FixAvailability, Violation};
use ruff_macros::{derive_message_formats, ViolationMetadata};
use ruff_python_ast::{name::QualifiedName, Arguments, Expr, ExprAttribute, ExprCall};
use ruff_python_semantic::Modules;
@ -43,6 +43,8 @@ pub(crate) struct Airflow3Removal {
}
impl Violation for Airflow3Removal {
const FIX_AVAILABILITY: FixAvailability = FixAvailability::Sometimes;
#[derive_message_formats]
fn message(&self) -> String {
let Airflow3Removal {
@ -51,14 +53,23 @@ impl Violation for Airflow3Removal {
} = self;
match replacement {
Replacement::None => format!("`{deprecated}` is removed in Airflow 3.0"),
Replacement::Name(name) => {
format!("`{deprecated}` is removed in Airflow 3.0; use `{name}` instead")
Replacement::Name(_) => {
format!("`{deprecated}` is removed in Airflow 3.0")
}
Replacement::Message(message) => {
format!("`{deprecated}` is removed in Airflow 3.0; {message}")
}
}
}
fn fix_title(&self) -> Option<String> {
let Airflow3Removal { replacement, .. } = self;
if let Replacement::Name(name) = replacement {
Some(format!("Use `{name}` instead"))
} else {
None
}
}
}
fn diagnostic_for_argument(
@ -67,7 +78,7 @@ fn diagnostic_for_argument(
replacement: Option<&str>,
) -> Option<Diagnostic> {
let keyword = arguments.find_keyword(deprecated)?;
Some(Diagnostic::new(
let mut diagnostic = Diagnostic::new(
Airflow3Removal {
deprecated: (*deprecated).to_string(),
replacement: match replacement {
@ -79,7 +90,16 @@ fn diagnostic_for_argument(
.arg
.as_ref()
.map_or_else(|| keyword.range(), Ranged::range),
))
);
if let Some(replacement) = replacement {
diagnostic.set_fix(Fix::safe_edit(Edit::range_replacement(
replacement.to_string(),
diagnostic.range,
)));
}
Some(diagnostic)
}
fn removed_argument(checker: &mut Checker, qualname: &QualifiedName, arguments: &Arguments) {

View file

@ -2,7 +2,7 @@
source: crates/ruff_linter/src/rules/airflow/mod.rs
snapshot_kind: text
---
AIR302_args.py:15:39: AIR302 `schedule_interval` is removed in Airflow 3.0; use `schedule` instead
AIR302_args.py:15:39: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
|
13 | DAG(dag_id="class_schedule", schedule="@hourly")
14 |
@ -11,14 +11,36 @@ AIR302_args.py:15:39: AIR302 `schedule_interval` is removed in Airflow 3.0; use
16 |
17 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
= help: Use `schedule` instead
AIR302_args.py:17:31: AIR302 `timetable` is removed in Airflow 3.0; use `schedule` instead
Safe fix
12 12 |
13 13 | DAG(dag_id="class_schedule", schedule="@hourly")
14 14 |
15 |-DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
15 |+DAG(dag_id="class_schedule_interval", schedule="@hourly")
16 16 |
17 17 | DAG(dag_id="class_timetable", timetable=NullTimetable())
18 18 |
AIR302_args.py:17:31: AIR302 [*] `timetable` is removed in Airflow 3.0
|
15 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
16 |
17 | DAG(dag_id="class_timetable", timetable=NullTimetable())
| ^^^^^^^^^ AIR302
|
= help: Use `schedule` instead
Safe fix
14 14 |
15 15 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
16 16 |
17 |-DAG(dag_id="class_timetable", timetable=NullTimetable())
17 |+DAG(dag_id="class_timetable", schedule=NullTimetable())
18 18 |
19 19 |
20 20 | def sla_callback(*arg, **kwargs):
AIR302_args.py:24:34: AIR302 `sla_miss_callback` is removed in Airflow 3.0
|
@ -26,21 +48,43 @@ AIR302_args.py:24:34: AIR302 `sla_miss_callback` is removed in Airflow 3.0
| ^^^^^^^^^^^^^^^^^ AIR302
|
AIR302_args.py:32:6: AIR302 `schedule_interval` is removed in Airflow 3.0; use `schedule` instead
AIR302_args.py:32:6: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
|
32 | @dag(schedule_interval="0 * * * *")
| ^^^^^^^^^^^^^^^^^ AIR302
33 | def decorator_schedule_interval():
34 | pass
|
= help: Use `schedule` instead
AIR302_args.py:37:6: AIR302 `timetable` is removed in Airflow 3.0; use `schedule` instead
Safe fix
29 29 | pass
30 30 |
31 31 |
32 |-@dag(schedule_interval="0 * * * *")
32 |+@dag(schedule="0 * * * *")
33 33 | def decorator_schedule_interval():
34 34 | pass
35 35 |
AIR302_args.py:37:6: AIR302 [*] `timetable` is removed in Airflow 3.0
|
37 | @dag(timetable=NullTimetable())
| ^^^^^^^^^ AIR302
38 | def decorator_timetable():
39 | pass
|
= help: Use `schedule` instead
Safe fix
34 34 | pass
35 35 |
36 36 |
37 |-@dag(timetable=NullTimetable())
37 |+@dag(schedule=NullTimetable())
38 38 | def decorator_timetable():
39 39 | pass
40 40 |
AIR302_args.py:42:6: AIR302 `sla_miss_callback` is removed in Airflow 3.0
|
@ -50,7 +94,7 @@ AIR302_args.py:42:6: AIR302 `sla_miss_callback` is removed in Airflow 3.0
44 | pass
|
AIR302_args.py:50:39: AIR302 `execution_date` is removed in Airflow 3.0; use `logical_date` instead
AIR302_args.py:50:39: AIR302 [*] `execution_date` is removed in Airflow 3.0
|
48 | def decorator_deprecated_operator_args():
49 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
@ -59,8 +103,19 @@ AIR302_args.py:50:39: AIR302 `execution_date` is removed in Airflow 3.0; use `lo
51 | )
52 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
= help: Use `logical_date` instead
AIR302_args.py:53:39: AIR302 `execution_date` is removed in Airflow 3.0; use `logical_date` instead
Safe fix
47 47 | @dag()
48 48 | def decorator_deprecated_operator_args():
49 49 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
50 |- task_id="trigger_dagrun_op1", execution_date="2024-12-04"
50 |+ task_id="trigger_dagrun_op1", logical_date="2024-12-04"
51 51 | )
52 52 | trigger_dagrun_op2 = TriggerDagRunOperator(
53 53 | task_id="trigger_dagrun_op2", execution_date="2024-12-04"
AIR302_args.py:53:39: AIR302 [*] `execution_date` is removed in Airflow 3.0
|
51 | )
52 | trigger_dagrun_op2 = TriggerDagRunOperator(
@ -68,8 +123,19 @@ AIR302_args.py:53:39: AIR302 `execution_date` is removed in Airflow 3.0; use `lo
| ^^^^^^^^^^^^^^ AIR302
54 | )
|
= help: Use `logical_date` instead
AIR302_args.py:57:33: AIR302 `use_task_execution_day` is removed in Airflow 3.0; use `use_task_logical_date` instead
Safe fix
50 50 | task_id="trigger_dagrun_op1", execution_date="2024-12-04"
51 51 | )
52 52 | trigger_dagrun_op2 = TriggerDagRunOperator(
53 |- task_id="trigger_dagrun_op2", execution_date="2024-12-04"
53 |+ task_id="trigger_dagrun_op2", logical_date="2024-12-04"
54 54 | )
55 55 |
56 56 | branch_dt_op = datetime.BranchDateTimeOperator(
AIR302_args.py:57:33: AIR302 [*] `use_task_execution_day` is removed in Airflow 3.0
|
56 | branch_dt_op = datetime.BranchDateTimeOperator(
57 | task_id="branch_dt_op", use_task_execution_day=True
@ -77,8 +143,19 @@ AIR302_args.py:57:33: AIR302 `use_task_execution_day` is removed in Airflow 3.0;
58 | )
59 | branch_dt_op2 = BranchDateTimeOperator(
|
= help: Use `use_task_logical_date` instead
AIR302_args.py:60:34: AIR302 `use_task_execution_day` is removed in Airflow 3.0; use `use_task_logical_date` instead
Safe fix
54 54 | )
55 55 |
56 56 | branch_dt_op = datetime.BranchDateTimeOperator(
57 |- task_id="branch_dt_op", use_task_execution_day=True
57 |+ task_id="branch_dt_op", use_task_logical_date=True
58 58 | )
59 59 | branch_dt_op2 = BranchDateTimeOperator(
60 60 | task_id="branch_dt_op2", use_task_execution_day=True
AIR302_args.py:60:34: AIR302 [*] `use_task_execution_day` is removed in Airflow 3.0
|
58 | )
59 | branch_dt_op2 = BranchDateTimeOperator(
@ -86,3 +163,14 @@ AIR302_args.py:60:34: AIR302 `use_task_execution_day` is removed in Airflow 3.0;
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
61 | )
|
= help: Use `use_task_logical_date` instead
Safe fix
57 57 | task_id="branch_dt_op", use_task_execution_day=True
58 58 | )
59 59 | branch_dt_op2 = BranchDateTimeOperator(
60 |- task_id="branch_dt_op2", use_task_execution_day=True
60 |+ task_id="branch_dt_op2", use_task_logical_date=True
61 61 | )
62 62 |
63 63 | dof_task_sensor = weekday.DayOfWeekSensor(

View file

@ -2,7 +2,7 @@
source: crates/ruff_linter/src/rules/airflow/mod.rs
snapshot_kind: text
---
AIR302_names.py:52:1: AIR302 `airflow.PY36` is removed in Airflow 3.0; use `sys.version_info` instead
AIR302_names.py:52:1: AIR302 `airflow.PY36` is removed in Airflow 3.0
|
50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |
@ -11,8 +11,9 @@ AIR302_names.py:52:1: AIR302 `airflow.PY36` is removed in Airflow 3.0; use `sys.
53 |
54 | AWSAthenaHook
|
= help: Use `sys.version_info` instead
AIR302_names.py:52:7: AIR302 `airflow.PY37` is removed in Airflow 3.0; use `sys.version_info` instead
AIR302_names.py:52:7: AIR302 `airflow.PY37` is removed in Airflow 3.0
|
50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |
@ -21,8 +22,9 @@ AIR302_names.py:52:7: AIR302 `airflow.PY37` is removed in Airflow 3.0; use `sys.
53 |
54 | AWSAthenaHook
|
= help: Use `sys.version_info` instead
AIR302_names.py:52:13: AIR302 `airflow.PY38` is removed in Airflow 3.0; use `sys.version_info` instead
AIR302_names.py:52:13: AIR302 `airflow.PY38` is removed in Airflow 3.0
|
50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |
@ -31,8 +33,9 @@ AIR302_names.py:52:13: AIR302 `airflow.PY38` is removed in Airflow 3.0; use `sys
53 |
54 | AWSAthenaHook
|
= help: Use `sys.version_info` instead
AIR302_names.py:52:19: AIR302 `airflow.PY39` is removed in Airflow 3.0; use `sys.version_info` instead
AIR302_names.py:52:19: AIR302 `airflow.PY39` is removed in Airflow 3.0
|
50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |
@ -41,8 +44,9 @@ AIR302_names.py:52:19: AIR302 `airflow.PY39` is removed in Airflow 3.0; use `sys
53 |
54 | AWSAthenaHook
|
= help: Use `sys.version_info` instead
AIR302_names.py:52:25: AIR302 `airflow.PY310` is removed in Airflow 3.0; use `sys.version_info` instead
AIR302_names.py:52:25: AIR302 `airflow.PY310` is removed in Airflow 3.0
|
50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |
@ -51,8 +55,9 @@ AIR302_names.py:52:25: AIR302 `airflow.PY310` is removed in Airflow 3.0; use `sy
53 |
54 | AWSAthenaHook
|
= help: Use `sys.version_info` instead
AIR302_names.py:52:32: AIR302 `airflow.PY311` is removed in Airflow 3.0; use `sys.version_info` instead
AIR302_names.py:52:32: AIR302 `airflow.PY311` is removed in Airflow 3.0
|
50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |
@ -61,8 +66,9 @@ AIR302_names.py:52:32: AIR302 `airflow.PY311` is removed in Airflow 3.0; use `sy
53 |
54 | AWSAthenaHook
|
= help: Use `sys.version_info` instead
AIR302_names.py:52:39: AIR302 `airflow.PY312` is removed in Airflow 3.0; use `sys.version_info` instead
AIR302_names.py:52:39: AIR302 `airflow.PY312` is removed in Airflow 3.0
|
50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |
@ -71,6 +77,7 @@ AIR302_names.py:52:39: AIR302 `airflow.PY312` is removed in Airflow 3.0; use `sy
53 |
54 | AWSAthenaHook
|
= help: Use `sys.version_info` instead
AIR302_names.py:54:1: AIR302 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is removed in Airflow 3.0
|
@ -90,7 +97,7 @@ AIR302_names.py:55:1: AIR302 `airflow.triggers.external_task.TaskStateTrigger` i
57 | requires_access
|
AIR302_names.py:57:1: AIR302 `airflow.api_connexion.security.requires_access` is removed in Airflow 3.0; use `airflow.api_connexion.security.requires_access_*` instead
AIR302_names.py:57:1: AIR302 `airflow.api_connexion.security.requires_access` is removed in Airflow 3.0
|
55 | TaskStateTrigger
56 |
@ -99,8 +106,9 @@ AIR302_names.py:57:1: AIR302 `airflow.api_connexion.security.requires_access` is
58 |
59 | AllowListValidator
|
= help: Use `airflow.api_connexion.security.requires_access_*` instead
AIR302_names.py:59:1: AIR302 `airflow.metrics.validators.AllowListValidator` is removed in Airflow 3.0; use `airflow.metrics.validators.PatternAllowListValidator` instead
AIR302_names.py:59:1: AIR302 `airflow.metrics.validators.AllowListValidator` is removed in Airflow 3.0
|
57 | requires_access
58 |
@ -108,8 +116,9 @@ AIR302_names.py:59:1: AIR302 `airflow.metrics.validators.AllowListValidator` is
| ^^^^^^^^^^^^^^^^^^ AIR302
60 | BlockListValidator
|
= help: Use `airflow.metrics.validators.PatternAllowListValidator` instead
AIR302_names.py:60:1: AIR302 `airflow.metrics.validators.BlockListValidator` is removed in Airflow 3.0; use `airflow.metrics.validators.PatternBlockListValidator` instead
AIR302_names.py:60:1: AIR302 `airflow.metrics.validators.BlockListValidator` is removed in Airflow 3.0
|
59 | AllowListValidator
60 | BlockListValidator
@ -117,6 +126,7 @@ AIR302_names.py:60:1: AIR302 `airflow.metrics.validators.BlockListValidator` is
61 |
62 | SubDagOperator
|
= help: Use `airflow.metrics.validators.PatternBlockListValidator` instead
AIR302_names.py:62:1: AIR302 `airflow.operators.subdag.SubDagOperator` is removed in Airflow 3.0
|
@ -128,7 +138,7 @@ AIR302_names.py:62:1: AIR302 `airflow.operators.subdag.SubDagOperator` is remove
64 | dates.date_range
|
AIR302_names.py:64:7: AIR302 `airflow.utils.dates.date_range` is removed in Airflow 3.0; use `airflow.timetables.` instead
AIR302_names.py:64:7: AIR302 `airflow.utils.dates.date_range` is removed in Airflow 3.0
|
62 | SubDagOperator
63 |
@ -136,8 +146,9 @@ AIR302_names.py:64:7: AIR302 `airflow.utils.dates.date_range` is removed in Airf
| ^^^^^^^^^^ AIR302
65 | dates.days_ago
|
= help: Use `airflow.timetables.` instead
AIR302_names.py:65:7: AIR302 `airflow.utils.dates.days_ago` is removed in Airflow 3.0; use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR302_names.py:65:7: AIR302 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
|
64 | dates.date_range
65 | dates.days_ago
@ -145,8 +156,9 @@ AIR302_names.py:65:7: AIR302 `airflow.utils.dates.days_ago` is removed in Airflo
66 |
67 | date_range
|
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR302_names.py:67:1: AIR302 `airflow.utils.dates.date_range` is removed in Airflow 3.0; use `airflow.timetables.` instead
AIR302_names.py:67:1: AIR302 `airflow.utils.dates.date_range` is removed in Airflow 3.0
|
65 | dates.days_ago
66 |
@ -155,8 +167,9 @@ AIR302_names.py:67:1: AIR302 `airflow.utils.dates.date_range` is removed in Airf
68 | days_ago
69 | parse_execution_date
|
= help: Use `airflow.timetables.` instead
AIR302_names.py:68:1: AIR302 `airflow.utils.dates.days_ago` is removed in Airflow 3.0; use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR302_names.py:68:1: AIR302 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
|
67 | date_range
68 | days_ago
@ -164,6 +177,7 @@ AIR302_names.py:68:1: AIR302 `airflow.utils.dates.days_ago` is removed in Airflo
69 | parse_execution_date
70 | round_time
|
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR302_names.py:69:1: AIR302 `airflow.utils.dates.parse_execution_date` is removed in Airflow 3.0
|
@ -202,7 +216,7 @@ AIR302_names.py:72:1: AIR302 `airflow.utils.dates.infer_time_unit` is removed in
| ^^^^^^^^^^^^^^^ AIR302
|
AIR302_names.py:79:1: AIR302 `airflow.configuration.get` is removed in Airflow 3.0; use `airflow.configuration.conf.get` instead
AIR302_names.py:79:1: AIR302 `airflow.configuration.get` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -211,8 +225,9 @@ AIR302_names.py:79:1: AIR302 `airflow.configuration.get` is removed in Airflow 3
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.get` instead
AIR302_names.py:79:6: AIR302 `airflow.configuration.getboolean` is removed in Airflow 3.0; use `airflow.configuration.conf.getboolean` instead
AIR302_names.py:79:6: AIR302 `airflow.configuration.getboolean` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -221,8 +236,9 @@ AIR302_names.py:79:6: AIR302 `airflow.configuration.getboolean` is removed in Ai
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.getboolean` instead
AIR302_names.py:79:18: AIR302 `airflow.configuration.getfloat` is removed in Airflow 3.0; use `airflow.configuration.conf.getfloat` instead
AIR302_names.py:79:18: AIR302 `airflow.configuration.getfloat` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -231,8 +247,9 @@ AIR302_names.py:79:18: AIR302 `airflow.configuration.getfloat` is removed in Air
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.getfloat` instead
AIR302_names.py:79:28: AIR302 `airflow.configuration.getint` is removed in Airflow 3.0; use `airflow.configuration.conf.getint` instead
AIR302_names.py:79:28: AIR302 `airflow.configuration.getint` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -241,8 +258,9 @@ AIR302_names.py:79:28: AIR302 `airflow.configuration.getint` is removed in Airfl
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.getint` instead
AIR302_names.py:79:36: AIR302 `airflow.configuration.has_option` is removed in Airflow 3.0; use `airflow.configuration.conf.has_option` instead
AIR302_names.py:79:36: AIR302 `airflow.configuration.has_option` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -251,8 +269,9 @@ AIR302_names.py:79:36: AIR302 `airflow.configuration.has_option` is removed in A
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.has_option` instead
AIR302_names.py:79:48: AIR302 `airflow.configuration.remove_option` is removed in Airflow 3.0; use `airflow.configuration.conf.remove_option` instead
AIR302_names.py:79:48: AIR302 `airflow.configuration.remove_option` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -261,8 +280,9 @@ AIR302_names.py:79:48: AIR302 `airflow.configuration.remove_option` is removed i
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.remove_option` instead
AIR302_names.py:79:63: AIR302 `airflow.configuration.as_dict` is removed in Airflow 3.0; use `airflow.configuration.conf.as_dict` instead
AIR302_names.py:79:63: AIR302 `airflow.configuration.as_dict` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -271,8 +291,9 @@ AIR302_names.py:79:63: AIR302 `airflow.configuration.as_dict` is removed in Airf
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.as_dict` instead
AIR302_names.py:79:72: AIR302 `airflow.configuration.set` is removed in Airflow 3.0; use `airflow.configuration.conf.set` instead
AIR302_names.py:79:72: AIR302 `airflow.configuration.set` is removed in Airflow 3.0
|
77 | dates.datetime_to_nano
78 |
@ -281,32 +302,36 @@ AIR302_names.py:79:72: AIR302 `airflow.configuration.set` is removed in Airflow
80 |
81 | get_connection, load_connections
|
= help: Use `airflow.configuration.conf.set` instead
AIR302_names.py:81:1: AIR302 `airflow.secrets.local_filesystem.get_connection` is removed in Airflow 3.0; use `airflow.secrets.local_filesystem.load_connections_dict` instead
AIR302_names.py:81:1: AIR302 `airflow.secrets.local_filesystem.get_connection` is removed in Airflow 3.0
|
79 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
80 |
81 | get_connection, load_connections
| ^^^^^^^^^^^^^^ AIR302
|
= help: Use `airflow.secrets.local_filesystem.load_connections_dict` instead
AIR302_names.py:81:17: AIR302 `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0; use `airflow.secrets.local_filesystem.load_connections_dict` instead
AIR302_names.py:81:17: AIR302 `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
|
79 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
80 |
81 | get_connection, load_connections
| ^^^^^^^^^^^^^^^^ AIR302
|
= help: Use `airflow.secrets.local_filesystem.load_connections_dict` instead
AIR302_names.py:84:1: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is removed in Airflow 3.0; use `airflow.sensors.external_task.ExternalTaskSensorLink` instead
AIR302_names.py:84:1: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is removed in Airflow 3.0
|
84 | ExternalTaskSensorLink
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
85 | BashOperator
86 | BaseBranchOperator
|
= help: Use `airflow.sensors.external_task.ExternalTaskSensorLink` instead
AIR302_names.py:85:1: AIR302 `airflow.operators.bash_operator.BashOperator` is removed in Airflow 3.0; use `airflow.operators.bash.BashOperator` instead
AIR302_names.py:85:1: AIR302 `airflow.operators.bash_operator.BashOperator` is removed in Airflow 3.0
|
84 | ExternalTaskSensorLink
85 | BashOperator
@ -314,8 +339,9 @@ AIR302_names.py:85:1: AIR302 `airflow.operators.bash_operator.BashOperator` is r
86 | BaseBranchOperator
87 | EmptyOperator, DummyOperator
|
= help: Use `airflow.operators.bash.BashOperator` instead
AIR302_names.py:86:1: AIR302 `airflow.operators.branch_operator.BaseBranchOperator` is removed in Airflow 3.0; use `airflow.operators.branch.BaseBranchOperator` instead
AIR302_names.py:86:1: AIR302 `airflow.operators.branch_operator.BaseBranchOperator` is removed in Airflow 3.0
|
84 | ExternalTaskSensorLink
85 | BashOperator
@ -324,8 +350,9 @@ AIR302_names.py:86:1: AIR302 `airflow.operators.branch_operator.BaseBranchOperat
87 | EmptyOperator, DummyOperator
88 | dummy_operator.EmptyOperator
|
= help: Use `airflow.operators.branch.BaseBranchOperator` instead
AIR302_names.py:87:16: AIR302 `airflow.operators.dummy.DummyOperator` is removed in Airflow 3.0; use `airflow.operators.empty.EmptyOperator` instead
AIR302_names.py:87:16: AIR302 `airflow.operators.dummy.DummyOperator` is removed in Airflow 3.0
|
85 | BashOperator
86 | BaseBranchOperator
@ -334,8 +361,9 @@ AIR302_names.py:87:16: AIR302 `airflow.operators.dummy.DummyOperator` is removed
88 | dummy_operator.EmptyOperator
89 | dummy_operator.DummyOperator
|
= help: Use `airflow.operators.empty.EmptyOperator` instead
AIR302_names.py:88:16: AIR302 `airflow.operators.dummy_operator.EmptyOperator` is removed in Airflow 3.0; use `airflow.operators.empty.EmptyOperator` instead
AIR302_names.py:88:16: AIR302 `airflow.operators.dummy_operator.EmptyOperator` is removed in Airflow 3.0
|
86 | BaseBranchOperator
87 | EmptyOperator, DummyOperator
@ -344,8 +372,9 @@ AIR302_names.py:88:16: AIR302 `airflow.operators.dummy_operator.EmptyOperator` i
89 | dummy_operator.DummyOperator
90 | EmailOperator
|
= help: Use `airflow.operators.empty.EmptyOperator` instead
AIR302_names.py:89:16: AIR302 `airflow.operators.dummy_operator.DummyOperator` is removed in Airflow 3.0; use `airflow.operators.empty.EmptyOperator` instead
AIR302_names.py:89:16: AIR302 `airflow.operators.dummy_operator.DummyOperator` is removed in Airflow 3.0
|
87 | EmptyOperator, DummyOperator
88 | dummy_operator.EmptyOperator
@ -354,8 +383,9 @@ AIR302_names.py:89:16: AIR302 `airflow.operators.dummy_operator.DummyOperator` i
90 | EmailOperator
91 | BaseSensorOperator
|
= help: Use `airflow.operators.empty.EmptyOperator` instead
AIR302_names.py:90:1: AIR302 `airflow.operators.email_operator.EmailOperator` is removed in Airflow 3.0; use `airflow.operators.email.EmailOperator` instead
AIR302_names.py:90:1: AIR302 `airflow.operators.email_operator.EmailOperator` is removed in Airflow 3.0
|
88 | dummy_operator.EmptyOperator
89 | dummy_operator.DummyOperator
@ -364,8 +394,9 @@ AIR302_names.py:90:1: AIR302 `airflow.operators.email_operator.EmailOperator` is
91 | BaseSensorOperator
92 | DateTimeSensor
|
= help: Use `airflow.operators.email.EmailOperator` instead
AIR302_names.py:91:1: AIR302 `airflow.sensors.base_sensor_operator.BaseSensorOperator` is removed in Airflow 3.0; use `airflow.sensors.base.BaseSensorOperator` instead
AIR302_names.py:91:1: AIR302 `airflow.sensors.base_sensor_operator.BaseSensorOperator` is removed in Airflow 3.0
|
89 | dummy_operator.DummyOperator
90 | EmailOperator
@ -374,8 +405,9 @@ AIR302_names.py:91:1: AIR302 `airflow.sensors.base_sensor_operator.BaseSensorOpe
92 | DateTimeSensor
93 | (ExternalTaskMarker, ExternalTaskSensor, ExternalTaskSensorLink)
|
= help: Use `airflow.sensors.base.BaseSensorOperator` instead
AIR302_names.py:92:1: AIR302 `airflow.sensors.date_time_sensor.DateTimeSensor` is removed in Airflow 3.0; use `airflow.sensors.date_time.DateTimeSensor` instead
AIR302_names.py:92:1: AIR302 `airflow.sensors.date_time_sensor.DateTimeSensor` is removed in Airflow 3.0
|
90 | EmailOperator
91 | BaseSensorOperator
@ -384,8 +416,9 @@ AIR302_names.py:92:1: AIR302 `airflow.sensors.date_time_sensor.DateTimeSensor` i
93 | (ExternalTaskMarker, ExternalTaskSensor, ExternalTaskSensorLink)
94 | TimeDeltaSensor
|
= help: Use `airflow.sensors.date_time.DateTimeSensor` instead
AIR302_names.py:93:2: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskMarker` is removed in Airflow 3.0; use `airflow.sensors.external_task.ExternalTaskMarker` instead
AIR302_names.py:93:2: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskMarker` is removed in Airflow 3.0
|
91 | BaseSensorOperator
92 | DateTimeSensor
@ -393,8 +426,9 @@ AIR302_names.py:93:2: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskM
| ^^^^^^^^^^^^^^^^^^ AIR302
94 | TimeDeltaSensor
|
= help: Use `airflow.sensors.external_task.ExternalTaskMarker` instead
AIR302_names.py:93:22: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskSensor` is removed in Airflow 3.0; use `airflow.sensors.external_task.ExternalTaskSensor` instead
AIR302_names.py:93:22: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskSensor` is removed in Airflow 3.0
|
91 | BaseSensorOperator
92 | DateTimeSensor
@ -402,8 +436,9 @@ AIR302_names.py:93:22: AIR302 `airflow.sensors.external_task_sensor.ExternalTask
| ^^^^^^^^^^^^^^^^^^ AIR302
94 | TimeDeltaSensor
|
= help: Use `airflow.sensors.external_task.ExternalTaskSensor` instead
AIR302_names.py:93:42: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is removed in Airflow 3.0; use `airflow.sensors.external_task.ExternalTaskSensorLink` instead
AIR302_names.py:93:42: AIR302 `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is removed in Airflow 3.0
|
91 | BaseSensorOperator
92 | DateTimeSensor
@ -411,8 +446,9 @@ AIR302_names.py:93:42: AIR302 `airflow.sensors.external_task_sensor.ExternalTask
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
94 | TimeDeltaSensor
|
= help: Use `airflow.sensors.external_task.ExternalTaskSensorLink` instead
AIR302_names.py:94:1: AIR302 `airflow.sensors.time_delta_sensor.TimeDeltaSensor` is removed in Airflow 3.0; use `airflow.sensors.time_delta.TimeDeltaSensor` instead
AIR302_names.py:94:1: AIR302 `airflow.sensors.time_delta_sensor.TimeDeltaSensor` is removed in Airflow 3.0
|
92 | DateTimeSensor
93 | (ExternalTaskMarker, ExternalTaskSensor, ExternalTaskSensorLink)
@ -421,6 +457,7 @@ AIR302_names.py:94:1: AIR302 `airflow.sensors.time_delta_sensor.TimeDeltaSensor`
95 |
96 | apply_defaults
|
= help: Use `airflow.sensors.time_delta.TimeDeltaSensor` instead
AIR302_names.py:96:1: AIR302 `airflow.utils.decorators.apply_defaults` is removed in Airflow 3.0; `apply_defaults` is now unconditionally done and can be safely removed.
|
@ -441,7 +478,7 @@ AIR302_names.py:98:1: AIR302 `airflow.utils.file.TemporaryDirectory` is removed
99 | mkdirs
|
AIR302_names.py:99:1: AIR302 `airflow.utils.file.mkdirs` is removed in Airflow 3.0; use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR302_names.py:99:1: AIR302 `airflow.utils.file.mkdirs` is removed in Airflow 3.0
|
98 | TemporaryDirectory
99 | mkdirs
@ -449,8 +486,9 @@ AIR302_names.py:99:1: AIR302 `airflow.utils.file.mkdirs` is removed in Airflow 3
100 |
101 | chain
|
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR302_names.py:101:1: AIR302 `airflow.utils.helpers.chain` is removed in Airflow 3.0; use `airflow.models.baseoperator.chain` instead
AIR302_names.py:101:1: AIR302 `airflow.utils.helpers.chain` is removed in Airflow 3.0
|
99 | mkdirs
100 |
@ -458,8 +496,9 @@ AIR302_names.py:101:1: AIR302 `airflow.utils.helpers.chain` is removed in Airflo
| ^^^^^ AIR302
102 | cross_downstream
|
= help: Use `airflow.models.baseoperator.chain` instead
AIR302_names.py:102:1: AIR302 `airflow.utils.helpers.cross_downstream` is removed in Airflow 3.0; use `airflow.models.baseoperator.cross_downstream` instead
AIR302_names.py:102:1: AIR302 `airflow.utils.helpers.cross_downstream` is removed in Airflow 3.0
|
101 | chain
102 | cross_downstream
@ -467,6 +506,7 @@ AIR302_names.py:102:1: AIR302 `airflow.utils.helpers.cross_downstream` is remove
103 |
104 | SHUTDOWN
|
= help: Use `airflow.models.baseoperator.cross_downstream` instead
AIR302_names.py:104:1: AIR302 `airflow.utils.state.SHUTDOWN` is removed in Airflow 3.0
|
@ -514,7 +554,7 @@ AIR302_names.py:110:1: AIR302 `airflow.utils.dag_cycle_tester.test_cycle` is rem
112 | has_access
|
AIR302_names.py:112:1: AIR302 `airflow.www.auth.has_access` is removed in Airflow 3.0; use `airflow.www.auth.has_access_*` instead
AIR302_names.py:112:1: AIR302 `airflow.www.auth.has_access` is removed in Airflow 3.0
|
110 | test_cycle
111 |
@ -522,17 +562,20 @@ AIR302_names.py:112:1: AIR302 `airflow.www.auth.has_access` is removed in Airflo
| ^^^^^^^^^^ AIR302
113 | get_sensitive_variables_fields, should_hide_value_for_key
|
= help: Use `airflow.www.auth.has_access_*` instead
AIR302_names.py:113:1: AIR302 `airflow.www.utils.get_sensitive_variables_fields` is removed in Airflow 3.0; use `airflow.utils.log.secrets_masker.get_sensitive_variables_fields` instead
AIR302_names.py:113:1: AIR302 `airflow.www.utils.get_sensitive_variables_fields` is removed in Airflow 3.0
|
112 | has_access
113 | get_sensitive_variables_fields, should_hide_value_for_key
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
= help: Use `airflow.utils.log.secrets_masker.get_sensitive_variables_fields` instead
AIR302_names.py:113:33: AIR302 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0; use `airflow.utils.log.secrets_masker.should_hide_value_for_key` instead
AIR302_names.py:113:33: AIR302 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0
|
112 | has_access
113 | get_sensitive_variables_fields, should_hide_value_for_key
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
= help: Use `airflow.utils.log.secrets_masker.should_hide_value_for_key` instead