mirror of https://github.com/astral-sh/ruff
[`airflow`] Extend `AIR302` with additional symbols (#17085)
## Summary
* ``airflow.auth.managers.base_auth_manager.is_authorized_dataset`` has
been moved to
``airflow.api_fastapi.auth.managers.base_auth_manager.is_authorized_asset``
in Airflow 3.0
* ``airflow.auth.managers.models.resource_details.DatasetDetails`` has
been moved to
``airflow.api_fastapi.auth.managers.models.resource_details.AssetDetails``
in Airflow 3.0
* Dag arguments `default_view` and `orientation` has been removed in
Airflow 3.0
* `airflow.models.baseoperatorlink.BaseOperatorLink` has been moved to
`airflow.sdk.definitions.baseoperatorlink.BaseOperatorLink` in Airflow
3.0
* ``airflow.notifications.basenotifier.BaseNotifier`` has been moved to
``airflow.sdk.BaseNotifier`` in Airflow 3.0
* ``airflow.utils.log.secrets_masker`` has been moved to
``airflow.sdk.execution_time.secrets_masker`` in Airflow 3.0
* ``airflow...DAG.allow_future_exec_dates`` has been removed in Airflow
3.0
* `airflow.utils.db.create_session` has een removed in Airflow 3.0
* `airflow.sensors.base_sensor_operator.BaseSensorOperator` has been
moved to `airflow.sdk.bases.sensor.BaseSensorOperator` removed Airflow
3.0
* `airflow.utils.file.TemporaryDirectory` has been removed in Airflow
3.0 and can be replaced by `tempfile.TemporaryDirectory`
* `airflow.utils.file.mkdirs` has been removed in Airflow 3.0 and can be
replaced by `pathlib.Path({path}).mkdir`
## Test Plan
Test fixture has been added for these changes
This commit is contained in:
parent
33bd08f49b
commit
fc2a0950eb
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from airflow import DAG, dag
|
from airflow import DAG, dag
|
||||||
|
|
@ -26,7 +28,14 @@ def sla_callback(*arg, **kwargs):
|
||||||
|
|
||||||
DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
||||||
|
|
||||||
DAG(dag_id="class_sla_callback", fail_stop=True)
|
DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||||
|
|
||||||
|
DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||||
|
|
||||||
|
DAG(dag_id="class_orientation", orientation="BT")
|
||||||
|
|
||||||
|
allow_future_exec_dates_dag = DAG(dag_id="class_allow_future_exec_dates")
|
||||||
|
allow_future_exec_dates_dag.allow_future_exec_dates
|
||||||
|
|
||||||
|
|
||||||
@dag(schedule="0 * * * *")
|
@dag(schedule="0 * * * *")
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,8 @@ from airflow.lineage.hook import DatasetLineageInfo
|
||||||
from airflow.listeners.spec.dataset import on_dataset_changed, on_dataset_created
|
from airflow.listeners.spec.dataset import on_dataset_changed, on_dataset_created
|
||||||
from airflow.metrics.validators import AllowListValidator, BlockListValidator
|
from airflow.metrics.validators import AllowListValidator, BlockListValidator
|
||||||
from airflow.models.baseoperator import chain, chain_linear, cross_downstream
|
from airflow.models.baseoperator import chain, chain_linear, cross_downstream
|
||||||
|
from airflow.models.baseoperatorlink import BaseOperatorLink
|
||||||
|
from airflow.notifications.basenotifier import BaseNotifier
|
||||||
from airflow.operators import dummy_operator
|
from airflow.operators import dummy_operator
|
||||||
from airflow.operators.branch_operator import BaseBranchOperator
|
from airflow.operators.branch_operator import BaseBranchOperator
|
||||||
from airflow.operators.dagrun_operator import TriggerDagRunLink, TriggerDagRunOperator
|
from airflow.operators.dagrun_operator import TriggerDagRunLink, TriggerDagRunOperator
|
||||||
|
|
@ -104,10 +106,12 @@ from airflow.utils.dates import (
|
||||||
round_time,
|
round_time,
|
||||||
scale_time_units,
|
scale_time_units,
|
||||||
)
|
)
|
||||||
|
from airflow.utils.db import create_session
|
||||||
from airflow.utils.decorators import apply_defaults
|
from airflow.utils.decorators import apply_defaults
|
||||||
from airflow.utils.file import TemporaryDirectory, mkdirs
|
from airflow.utils.file import TemporaryDirectory, mkdirs
|
||||||
from airflow.utils.helpers import chain as helper_chain
|
from airflow.utils.helpers import chain as helper_chain
|
||||||
from airflow.utils.helpers import cross_downstream as helper_cross_downstream
|
from airflow.utils.helpers import cross_downstream as helper_cross_downstream
|
||||||
|
from airflow.utils.log import secrets_masker
|
||||||
from airflow.utils.state import SHUTDOWN, terminating_states
|
from airflow.utils.state import SHUTDOWN, terminating_states
|
||||||
from airflow.utils.trigger_rule import TriggerRule
|
from airflow.utils.trigger_rule import TriggerRule
|
||||||
from airflow.www.auth import has_access, has_access_dataset
|
from airflow.www.auth import has_access, has_access_dataset
|
||||||
|
|
@ -163,6 +167,12 @@ BlockListValidator()
|
||||||
# airflow.models.baseoperator
|
# airflow.models.baseoperator
|
||||||
chain, chain_linear, cross_downstream
|
chain, chain_linear, cross_downstream
|
||||||
|
|
||||||
|
# airflow.models.baseoperatorlink
|
||||||
|
BaseOperatorLink()
|
||||||
|
|
||||||
|
# ariflow.notifications.basenotifier
|
||||||
|
BaseNotifier()
|
||||||
|
|
||||||
# airflow.operators.dummy
|
# airflow.operators.dummy
|
||||||
EmptyOperator()
|
EmptyOperator()
|
||||||
DummyOperator()
|
DummyOperator()
|
||||||
|
|
@ -282,6 +292,9 @@ test_cycle
|
||||||
# airflow.utils.dag_parsing_context
|
# airflow.utils.dag_parsing_context
|
||||||
get_parsing_context
|
get_parsing_context
|
||||||
|
|
||||||
|
# airflow.utils.db
|
||||||
|
create_session
|
||||||
|
|
||||||
# airflow.utils.decorators
|
# airflow.utils.decorators
|
||||||
apply_defaults
|
apply_defaults
|
||||||
|
|
||||||
|
|
@ -293,6 +306,9 @@ mkdirs
|
||||||
helper_chain
|
helper_chain
|
||||||
helper_cross_downstream
|
helper_cross_downstream
|
||||||
|
|
||||||
|
# airflow.utils.log
|
||||||
|
secrets_masker
|
||||||
|
|
||||||
# airflow.utils.state
|
# airflow.utils.state
|
||||||
SHUTDOWN
|
SHUTDOWN
|
||||||
terminating_states
|
terminating_states
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,12 @@ fn check_function_parameters(checker: &Checker, function_def: &StmtFunctionDef)
|
||||||
fn check_call_arguments(checker: &Checker, qualified_name: &QualifiedName, arguments: &Arguments) {
|
fn check_call_arguments(checker: &Checker, qualified_name: &QualifiedName, arguments: &Arguments) {
|
||||||
match qualified_name.segments() {
|
match qualified_name.segments() {
|
||||||
["airflow", .., "DAG" | "dag"] => {
|
["airflow", .., "DAG" | "dag"] => {
|
||||||
|
// with replacement
|
||||||
|
checker.report_diagnostics(diagnostic_for_argument(
|
||||||
|
arguments,
|
||||||
|
"fail_stop",
|
||||||
|
Some("fail_fast"),
|
||||||
|
));
|
||||||
checker.report_diagnostics(diagnostic_for_argument(
|
checker.report_diagnostics(diagnostic_for_argument(
|
||||||
arguments,
|
arguments,
|
||||||
"schedule_interval",
|
"schedule_interval",
|
||||||
|
|
@ -196,16 +202,14 @@ fn check_call_arguments(checker: &Checker, qualified_name: &QualifiedName, argum
|
||||||
"timetable",
|
"timetable",
|
||||||
Some("schedule"),
|
Some("schedule"),
|
||||||
));
|
));
|
||||||
|
// without replacement
|
||||||
|
checker.report_diagnostics(diagnostic_for_argument(arguments, "default_view", None));
|
||||||
|
checker.report_diagnostics(diagnostic_for_argument(arguments, "orientation", None));
|
||||||
checker.report_diagnostics(diagnostic_for_argument(
|
checker.report_diagnostics(diagnostic_for_argument(
|
||||||
arguments,
|
arguments,
|
||||||
"sla_miss_callback",
|
"sla_miss_callback",
|
||||||
None,
|
None,
|
||||||
));
|
));
|
||||||
checker.report_diagnostics(diagnostic_for_argument(
|
|
||||||
arguments,
|
|
||||||
"fail_stop",
|
|
||||||
Some("fail_fast"),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
if is_airflow_auth_manager(qualified_name.segments()) {
|
if is_airflow_auth_manager(qualified_name.segments()) {
|
||||||
|
|
@ -562,10 +566,14 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
|
||||||
|
|
||||||
// airflow.auth.managers
|
// airflow.auth.managers
|
||||||
["airflow", "auth", "managers", "models", "resource_details", "DatasetDetails"] => {
|
["airflow", "auth", "managers", "models", "resource_details", "DatasetDetails"] => {
|
||||||
Replacement::Name("airflow.auth.managers.models.resource_details.AssetDetails")
|
Replacement::Name(
|
||||||
|
"airflow.api_fastapi.auth.managers.models.resource_details.AssetDetails",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
["airflow", "auth", "managers", "base_auth_manager", "is_authorized_dataset"] => {
|
["airflow", "auth", "managers", "base_auth_manager", "is_authorized_dataset"] => {
|
||||||
Replacement::Name("airflow.auth.managers.base_auth_manager.is_authorized_asset")
|
Replacement::Name(
|
||||||
|
"airflow.api_fastapi.auth.managers.base_auth_manager.is_authorized_asset",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// airflow.configuration
|
// airflow.configuration
|
||||||
|
|
@ -648,6 +656,14 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
|
||||||
["airflow", "models", "baseoperator", "cross_downstream"] => {
|
["airflow", "models", "baseoperator", "cross_downstream"] => {
|
||||||
Replacement::Name("airflow.sdk.cross_downstream")
|
Replacement::Name("airflow.sdk.cross_downstream")
|
||||||
}
|
}
|
||||||
|
["airflow", "models", "baseoperatorlink", "BaseOperatorLink"] => {
|
||||||
|
Replacement::Name("airflow.sdk.definitions.baseoperatorlink.BaseOperatorLink")
|
||||||
|
}
|
||||||
|
|
||||||
|
// airflow.notifications
|
||||||
|
["airflow", "notifications", "basenotifier", "BaseNotifier"] => {
|
||||||
|
Replacement::Name("airflow.sdk.BaseNotifier")
|
||||||
|
}
|
||||||
|
|
||||||
// airflow.operators
|
// airflow.operators
|
||||||
["airflow", "operators", "subdag", ..] => {
|
["airflow", "operators", "subdag", ..] => {
|
||||||
|
|
@ -696,7 +712,7 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
|
||||||
|
|
||||||
// airflow.sensors
|
// airflow.sensors
|
||||||
["airflow", "sensors", "base_sensor_operator", "BaseSensorOperator"] => {
|
["airflow", "sensors", "base_sensor_operator", "BaseSensorOperator"] => {
|
||||||
Replacement::Name("airflow.sensors.base.BaseSensorOperator")
|
Replacement::Name("airflow.sdk.bases.sensor.BaseSensorOperator")
|
||||||
}
|
}
|
||||||
["airflow", "sensors", "date_time_sensor", "DateTimeSensor"] => {
|
["airflow", "sensors", "date_time_sensor", "DateTimeSensor"] => {
|
||||||
Replacement::Name("airflow.sensors.date_time.DateTimeSensor")
|
Replacement::Name("airflow.sensors.date_time.DateTimeSensor")
|
||||||
|
|
@ -738,6 +754,9 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
|
||||||
Replacement::Name("airflow.sdk.get_parsing_context")
|
Replacement::Name("airflow.sdk.get_parsing_context")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// airflow.utils.db
|
||||||
|
["db", "create_session"] => Replacement::None,
|
||||||
|
|
||||||
// airflow.utils.decorators
|
// airflow.utils.decorators
|
||||||
["decorators", "apply_defaults"] => Replacement::Message(
|
["decorators", "apply_defaults"] => Replacement::Message(
|
||||||
"`apply_defaults` is now unconditionally done and can be safely removed.",
|
"`apply_defaults` is now unconditionally done and can be safely removed.",
|
||||||
|
|
@ -751,13 +770,18 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// airflow.utils.file
|
// airflow.utils.file
|
||||||
["file", "TemporaryDirectory"] => Replacement::None,
|
["file", "TemporaryDirectory"] => Replacement::Name("tempfile.TemporaryDirectory"),
|
||||||
["file", "mkdirs"] => Replacement::Name("pendulum.today('UTC').add(days=-N, ...)"),
|
["file", "mkdirs"] => Replacement::Name("pathlib.Path({path}).mkdir"),
|
||||||
|
|
||||||
// airflow.utils.helpers
|
// airflow.utils.helpers
|
||||||
["helpers", "chain"] => Replacement::Name("airflow.sdk.chain"),
|
["helpers", "chain"] => Replacement::Name("airflow.sdk.chain"),
|
||||||
["helpers", "cross_downstream"] => Replacement::Name("airflow.sdk.cross_downstream"),
|
["helpers", "cross_downstream"] => Replacement::Name("airflow.sdk.cross_downstream"),
|
||||||
|
|
||||||
|
// airflow.utils.log.secrets_masker
|
||||||
|
["log", "secrets_masker"] => {
|
||||||
|
Replacement::Name("airflow.sdk.execution_time.secrets_masker")
|
||||||
|
}
|
||||||
|
|
||||||
// airflow.utils.state
|
// airflow.utils.state
|
||||||
["state", "SHUTDOWN" | "terminating_states"] => Replacement::None,
|
["state", "SHUTDOWN" | "terminating_states"] => Replacement::None,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,273 +1,294 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
AIR302_args.py:18:39: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
|
AIR302_args.py:20:39: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
16 | DAG(dag_id="class_schedule", schedule="@hourly")
|
18 | DAG(dag_id="class_schedule", schedule="@hourly")
|
||||||
17 |
|
|
||||||
18 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
|
||||||
19 |
|
19 |
|
||||||
20 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
20 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
||||||
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
|
21 |
|
||||||
|
22 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||||
|
|
|
|
||||||
= help: Use `schedule` instead
|
= help: Use `schedule` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
15 15 |
|
|
||||||
16 16 | DAG(dag_id="class_schedule", schedule="@hourly")
|
|
||||||
17 17 |
|
17 17 |
|
||||||
18 |-DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
18 18 | DAG(dag_id="class_schedule", schedule="@hourly")
|
||||||
18 |+DAG(dag_id="class_schedule_interval", schedule="@hourly")
|
|
||||||
19 19 |
|
19 19 |
|
||||||
20 20 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
20 |-DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
||||||
|
20 |+DAG(dag_id="class_schedule_interval", schedule="@hourly")
|
||||||
21 21 |
|
21 21 |
|
||||||
|
22 22 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||||
|
23 23 |
|
||||||
|
|
||||||
AIR302_args.py:20:31: AIR302 [*] `timetable` is removed in Airflow 3.0
|
AIR302_args.py:22:31: AIR302 [*] `timetable` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
18 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
20 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
||||||
19 |
|
21 |
|
||||||
20 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
22 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||||
| ^^^^^^^^^ AIR302
|
| ^^^^^^^^^ AIR302
|
||||||
|
|
|
|
||||||
= help: Use `schedule` instead
|
= help: Use `schedule` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
17 17 |
|
|
||||||
18 18 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
|
||||||
19 19 |
|
19 19 |
|
||||||
20 |-DAG(dag_id="class_timetable", timetable=NullTimetable())
|
20 20 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
||||||
20 |+DAG(dag_id="class_timetable", schedule=NullTimetable())
|
|
||||||
21 21 |
|
21 21 |
|
||||||
22 22 |
|
22 |-DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||||
23 23 | def sla_callback(*arg, **kwargs):
|
22 |+DAG(dag_id="class_timetable", schedule=NullTimetable())
|
||||||
|
23 23 |
|
||||||
|
24 24 |
|
||||||
|
25 25 | def sla_callback(*arg, **kwargs):
|
||||||
|
|
||||||
AIR302_args.py:27:34: AIR302 `sla_miss_callback` is removed in Airflow 3.0
|
AIR302_args.py:29:34: AIR302 `sla_miss_callback` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
27 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
29 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
28 |
|
30 |
|
||||||
29 | DAG(dag_id="class_sla_callback", fail_stop=True)
|
31 | DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||||
|
|
|
|
||||||
|
|
||||||
AIR302_args.py:29:34: AIR302 [*] `fail_stop` is removed in Airflow 3.0
|
AIR302_args.py:31:31: AIR302 [*] `fail_stop` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
27 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
29 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
||||||
28 |
|
30 |
|
||||||
29 | DAG(dag_id="class_sla_callback", fail_stop=True)
|
31 | DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||||
| ^^^^^^^^^ AIR302
|
| ^^^^^^^^^ AIR302
|
||||||
|
32 |
|
||||||
|
33 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||||
|
|
|
|
||||||
= help: Use `fail_fast` instead
|
= help: Use `fail_fast` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
26 26 |
|
|
||||||
27 27 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
|
||||||
28 28 |
|
28 28 |
|
||||||
29 |-DAG(dag_id="class_sla_callback", fail_stop=True)
|
29 29 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
||||||
29 |+DAG(dag_id="class_sla_callback", fail_fast=True)
|
|
||||||
30 30 |
|
30 30 |
|
||||||
31 31 |
|
31 |-DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||||
32 32 | @dag(schedule="0 * * * *")
|
31 |+DAG(dag_id="class_fail_stop", fail_fast=True)
|
||||||
|
32 32 |
|
||||||
|
33 33 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||||
|
34 34 |
|
||||||
|
|
||||||
AIR302_args.py:37:6: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
|
AIR302_args.py:33:34: AIR302 `default_view` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
37 | @dag(schedule_interval="0 * * * *")
|
31 | DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||||
|
32 |
|
||||||
|
33 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||||
|
| ^^^^^^^^^^^^ AIR302
|
||||||
|
34 |
|
||||||
|
35 | DAG(dag_id="class_orientation", orientation="BT")
|
||||||
|
|
|
||||||
|
|
||||||
|
AIR302_args.py:35:33: AIR302 `orientation` is removed in Airflow 3.0
|
||||||
|
|
|
||||||
|
33 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||||
|
34 |
|
||||||
|
35 | DAG(dag_id="class_orientation", orientation="BT")
|
||||||
|
| ^^^^^^^^^^^ AIR302
|
||||||
|
36 |
|
||||||
|
37 | allow_future_exec_dates_dag = DAG(dag_id="class_allow_future_exec_dates")
|
||||||
|
|
|
||||||
|
|
||||||
|
AIR302_args.py:46:6: AIR302 [*] `schedule_interval` is removed in Airflow 3.0
|
||||||
|
|
|
||||||
|
46 | @dag(schedule_interval="0 * * * *")
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
38 | def decorator_schedule_interval():
|
47 | def decorator_schedule_interval():
|
||||||
39 | pass
|
48 | pass
|
||||||
|
|
|
|
||||||
= help: Use `schedule` instead
|
= help: Use `schedule` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
34 34 | pass
|
43 43 | pass
|
||||||
35 35 |
|
44 44 |
|
||||||
36 36 |
|
|
||||||
37 |-@dag(schedule_interval="0 * * * *")
|
|
||||||
37 |+@dag(schedule="0 * * * *")
|
|
||||||
38 38 | def decorator_schedule_interval():
|
|
||||||
39 39 | pass
|
|
||||||
40 40 |
|
|
||||||
|
|
||||||
AIR302_args.py:42:6: AIR302 [*] `timetable` is removed in Airflow 3.0
|
|
||||||
|
|
|
||||||
42 | @dag(timetable=NullTimetable())
|
|
||||||
| ^^^^^^^^^ AIR302
|
|
||||||
43 | def decorator_timetable():
|
|
||||||
44 | pass
|
|
||||||
|
|
|
||||||
= help: Use `schedule` instead
|
|
||||||
|
|
||||||
ℹ Safe fix
|
|
||||||
39 39 | pass
|
|
||||||
40 40 |
|
|
||||||
41 41 |
|
|
||||||
42 |-@dag(timetable=NullTimetable())
|
|
||||||
42 |+@dag(schedule=NullTimetable())
|
|
||||||
43 43 | def decorator_timetable():
|
|
||||||
44 44 | pass
|
|
||||||
45 45 |
|
45 45 |
|
||||||
|
46 |-@dag(schedule_interval="0 * * * *")
|
||||||
|
46 |+@dag(schedule="0 * * * *")
|
||||||
|
47 47 | def decorator_schedule_interval():
|
||||||
|
48 48 | pass
|
||||||
|
49 49 |
|
||||||
|
|
||||||
AIR302_args.py:47:6: AIR302 `sla_miss_callback` is removed in Airflow 3.0
|
AIR302_args.py:51:6: AIR302 [*] `timetable` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
47 | @dag(sla_miss_callback=sla_callback)
|
51 | @dag(timetable=NullTimetable())
|
||||||
|
| ^^^^^^^^^ AIR302
|
||||||
|
52 | def decorator_timetable():
|
||||||
|
53 | pass
|
||||||
|
|
|
||||||
|
= help: Use `schedule` instead
|
||||||
|
|
||||||
|
ℹ Safe fix
|
||||||
|
48 48 | pass
|
||||||
|
49 49 |
|
||||||
|
50 50 |
|
||||||
|
51 |-@dag(timetable=NullTimetable())
|
||||||
|
51 |+@dag(schedule=NullTimetable())
|
||||||
|
52 52 | def decorator_timetable():
|
||||||
|
53 53 | pass
|
||||||
|
54 54 |
|
||||||
|
|
||||||
|
AIR302_args.py:56:6: AIR302 `sla_miss_callback` is removed in Airflow 3.0
|
||||||
|
|
|
||||||
|
56 | @dag(sla_miss_callback=sla_callback)
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
48 | def decorator_sla_callback():
|
57 | def decorator_sla_callback():
|
||||||
49 | pass
|
58 | pass
|
||||||
|
|
|
|
||||||
|
|
||||||
AIR302_args.py:55:39: AIR302 [*] `execution_date` is removed in Airflow 3.0
|
AIR302_args.py:64:39: AIR302 [*] `execution_date` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
53 | def decorator_deprecated_operator_args():
|
62 | def decorator_deprecated_operator_args():
|
||||||
54 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
|
63 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
|
||||||
55 | task_id="trigger_dagrun_op1", execution_date="2024-12-04"
|
64 | task_id="trigger_dagrun_op1", execution_date="2024-12-04"
|
||||||
| ^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^ AIR302
|
||||||
56 | )
|
65 | )
|
||||||
57 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
66 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
||||||
|
|
|
|
||||||
= help: Use `logical_date` instead
|
= help: Use `logical_date` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
52 52 | @dag()
|
61 61 | @dag()
|
||||||
53 53 | def decorator_deprecated_operator_args():
|
62 62 | def decorator_deprecated_operator_args():
|
||||||
54 54 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
|
63 63 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
|
||||||
55 |- task_id="trigger_dagrun_op1", execution_date="2024-12-04"
|
64 |- task_id="trigger_dagrun_op1", execution_date="2024-12-04"
|
||||||
55 |+ task_id="trigger_dagrun_op1", logical_date="2024-12-04"
|
64 |+ task_id="trigger_dagrun_op1", logical_date="2024-12-04"
|
||||||
56 56 | )
|
65 65 | )
|
||||||
57 57 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
66 66 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
||||||
58 58 | task_id="trigger_dagrun_op2", execution_date="2024-12-04"
|
67 67 | task_id="trigger_dagrun_op2", execution_date="2024-12-04"
|
||||||
|
|
||||||
AIR302_args.py:58:39: AIR302 [*] `execution_date` is removed in Airflow 3.0
|
AIR302_args.py:67:39: AIR302 [*] `execution_date` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
56 | )
|
65 | )
|
||||||
57 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
66 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
||||||
58 | task_id="trigger_dagrun_op2", execution_date="2024-12-04"
|
67 | task_id="trigger_dagrun_op2", execution_date="2024-12-04"
|
||||||
| ^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^ AIR302
|
||||||
59 | )
|
68 | )
|
||||||
|
|
|
|
||||||
= help: Use `logical_date` instead
|
= help: Use `logical_date` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
55 55 | task_id="trigger_dagrun_op1", execution_date="2024-12-04"
|
64 64 | task_id="trigger_dagrun_op1", execution_date="2024-12-04"
|
||||||
56 56 | )
|
65 65 | )
|
||||||
57 57 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
66 66 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
||||||
58 |- task_id="trigger_dagrun_op2", execution_date="2024-12-04"
|
67 |- task_id="trigger_dagrun_op2", execution_date="2024-12-04"
|
||||||
58 |+ task_id="trigger_dagrun_op2", logical_date="2024-12-04"
|
67 |+ task_id="trigger_dagrun_op2", logical_date="2024-12-04"
|
||||||
59 59 | )
|
68 68 | )
|
||||||
60 60 |
|
69 69 |
|
||||||
61 61 | branch_dt_op = datetime.BranchDateTimeOperator(
|
70 70 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||||
|
|
||||||
AIR302_args.py:62:33: AIR302 [*] `use_task_execution_day` is removed in Airflow 3.0
|
AIR302_args.py:71:33: AIR302 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
61 | branch_dt_op = datetime.BranchDateTimeOperator(
|
70 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||||
62 | task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
71 | task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||||
63 | )
|
72 | )
|
||||||
64 | branch_dt_op2 = BranchDateTimeOperator(
|
73 | branch_dt_op2 = BranchDateTimeOperator(
|
||||||
|
|
|
|
||||||
= help: Use `use_task_logical_date` instead
|
= help: Use `use_task_logical_date` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
59 59 | )
|
68 68 | )
|
||||||
60 60 |
|
69 69 |
|
||||||
61 61 | branch_dt_op = datetime.BranchDateTimeOperator(
|
70 70 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||||
62 |- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
71 |- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
||||||
62 |+ task_id="branch_dt_op", use_task_logical_date=True, task_concurrency=5
|
71 |+ task_id="branch_dt_op", use_task_logical_date=True, task_concurrency=5
|
||||||
63 63 | )
|
72 72 | )
|
||||||
64 64 | branch_dt_op2 = BranchDateTimeOperator(
|
73 73 | branch_dt_op2 = BranchDateTimeOperator(
|
||||||
65 65 | task_id="branch_dt_op2",
|
74 74 | task_id="branch_dt_op2",
|
||||||
|
|
||||||
AIR302_args.py:62:62: AIR302 [*] `task_concurrency` is removed in Airflow 3.0
|
AIR302_args.py:71:62: AIR302 [*] `task_concurrency` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
61 | branch_dt_op = datetime.BranchDateTimeOperator(
|
70 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||||
62 | task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
71 | task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
||||||
| ^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^ AIR302
|
||||||
63 | )
|
72 | )
|
||||||
64 | branch_dt_op2 = BranchDateTimeOperator(
|
73 | branch_dt_op2 = BranchDateTimeOperator(
|
||||||
|
|
|
|
||||||
= help: Use `max_active_tis_per_dag` instead
|
= help: Use `max_active_tis_per_dag` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
59 59 | )
|
68 68 | )
|
||||||
60 60 |
|
69 69 |
|
||||||
61 61 | branch_dt_op = datetime.BranchDateTimeOperator(
|
70 70 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||||
62 |- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
71 |- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
||||||
62 |+ task_id="branch_dt_op", use_task_execution_day=True, max_active_tis_per_dag=5
|
71 |+ task_id="branch_dt_op", use_task_execution_day=True, max_active_tis_per_dag=5
|
||||||
63 63 | )
|
72 72 | )
|
||||||
64 64 | branch_dt_op2 = BranchDateTimeOperator(
|
73 73 | branch_dt_op2 = BranchDateTimeOperator(
|
||||||
65 65 | task_id="branch_dt_op2",
|
74 74 | task_id="branch_dt_op2",
|
||||||
|
|
||||||
AIR302_args.py:66:9: AIR302 [*] `use_task_execution_day` is removed in Airflow 3.0
|
AIR302_args.py:75:9: AIR302 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
64 | branch_dt_op2 = BranchDateTimeOperator(
|
73 | branch_dt_op2 = BranchDateTimeOperator(
|
||||||
65 | task_id="branch_dt_op2",
|
74 | task_id="branch_dt_op2",
|
||||||
66 | use_task_execution_day=True,
|
75 | use_task_execution_day=True,
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||||
67 | sla=timedelta(seconds=10),
|
76 | sla=timedelta(seconds=10),
|
||||||
68 | )
|
77 | )
|
||||||
|
|
|
|
||||||
= help: Use `use_task_logical_date` instead
|
= help: Use `use_task_logical_date` instead
|
||||||
|
|
||||||
ℹ Safe fix
|
ℹ Safe fix
|
||||||
63 63 | )
|
72 72 | )
|
||||||
64 64 | branch_dt_op2 = BranchDateTimeOperator(
|
73 73 | branch_dt_op2 = BranchDateTimeOperator(
|
||||||
65 65 | task_id="branch_dt_op2",
|
74 74 | task_id="branch_dt_op2",
|
||||||
66 |- use_task_execution_day=True,
|
75 |- use_task_execution_day=True,
|
||||||
66 |+ use_task_logical_date=True,
|
75 |+ use_task_logical_date=True,
|
||||||
67 67 | sla=timedelta(seconds=10),
|
76 76 | sla=timedelta(seconds=10),
|
||||||
68 68 | )
|
77 77 | )
|
||||||
69 69 |
|
78 78 |
|
||||||
|
|
||||||
AIR302_args.py:67:9: AIR302 `sla` is removed in Airflow 3.0
|
AIR302_args.py:76:9: AIR302 `sla` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
65 | task_id="branch_dt_op2",
|
74 | task_id="branch_dt_op2",
|
||||||
66 | use_task_execution_day=True,
|
75 | use_task_execution_day=True,
|
||||||
67 | sla=timedelta(seconds=10),
|
76 | sla=timedelta(seconds=10),
|
||||||
| ^^^ AIR302
|
| ^^^ AIR302
|
||||||
68 | )
|
77 | )
|
||||||
|
|
|
|
||||||
|
|
||||||
AIR302_args.py:89:15: AIR302 `filename_template` is removed in Airflow 3.0
|
AIR302_args.py:98:15: AIR302 `filename_template` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
88 | # deprecated filename_template argument in FileTaskHandler
|
97 | # deprecated filename_template argument in FileTaskHandler
|
||||||
89 | S3TaskHandler(filename_template="/tmp/test")
|
98 | S3TaskHandler(filename_template="/tmp/test")
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
99 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||||
91 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
100 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||||
|
|
|
|
||||||
|
|
||||||
AIR302_args.py:90:17: AIR302 `filename_template` is removed in Airflow 3.0
|
AIR302_args.py:99:17: AIR302 `filename_template` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
88 | # deprecated filename_template argument in FileTaskHandler
|
97 | # deprecated filename_template argument in FileTaskHandler
|
||||||
89 | S3TaskHandler(filename_template="/tmp/test")
|
98 | S3TaskHandler(filename_template="/tmp/test")
|
||||||
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
99 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
91 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
100 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||||
92 | GCSTaskHandler(filename_template="/tmp/test")
|
101 | GCSTaskHandler(filename_template="/tmp/test")
|
||||||
|
|
|
|
||||||
|
|
||||||
AIR302_args.py:91:26: AIR302 `filename_template` is removed in Airflow 3.0
|
AIR302_args.py:100:26: AIR302 `filename_template` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
89 | S3TaskHandler(filename_template="/tmp/test")
|
98 | S3TaskHandler(filename_template="/tmp/test")
|
||||||
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
99 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||||
91 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
100 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
92 | GCSTaskHandler(filename_template="/tmp/test")
|
101 | GCSTaskHandler(filename_template="/tmp/test")
|
||||||
|
|
|
|
||||||
|
|
||||||
AIR302_args.py:92:16: AIR302 `filename_template` is removed in Airflow 3.0
|
AIR302_args.py:101:16: AIR302 `filename_template` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
99 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||||
91 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
100 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||||
92 | GCSTaskHandler(filename_template="/tmp/test")
|
101 | GCSTaskHandler(filename_template="/tmp/test")
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
93 |
|
102 |
|
||||||
94 | FabAuthManager(None)
|
103 | FabAuthManager(None)
|
||||||
|
|
|
|
||||||
|
|
||||||
AIR302_args.py:94:15: AIR302 `appbuilder` is removed in Airflow 3.0; The constructor takes no parameter now
|
AIR302_args.py:103:15: AIR302 `appbuilder` is removed in Airflow 3.0; The constructor takes no parameter now
|
||||||
|
|
|
|
||||||
92 | GCSTaskHandler(filename_template="/tmp/test")
|
101 | GCSTaskHandler(filename_template="/tmp/test")
|
||||||
93 |
|
102 |
|
||||||
94 | FabAuthManager(None)
|
103 | FabAuthManager(None)
|
||||||
| ^^^^^^ AIR302
|
| ^^^^^^ AIR302
|
||||||
|
|
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue