[`airflow`] Add unsafe fix for module moved cases (`AIR301`) (#18367)

<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Follow up on https://github.com/astral-sh/ruff/pull/18093 and apply it
to AIR301

## Test Plan

<!-- How was it tested? -->

The existing test fixtures have been updated
This commit is contained in:
Wei Lee 2025-05-30 20:46:39 +08:00 committed by GitHub
parent ad2f667ee4
commit b5b6b657cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 1218 additions and 1065 deletions

View File

@ -10,22 +10,10 @@ from airflow import (
PY312, PY312,
) )
from airflow.api_connexion.security import requires_access from airflow.api_connexion.security import requires_access
from airflow.configuration import (
as_dict,
get,
getboolean,
getfloat,
getint,
has_option,
remove_option,
set,
)
from airflow.contrib.aws_athena_hook import AWSAthenaHook from airflow.contrib.aws_athena_hook import AWSAthenaHook
from airflow.datasets import DatasetAliasEvent from airflow.datasets import DatasetAliasEvent
from airflow.hooks.base_hook import BaseHook
from airflow.operators.subdag import SubDagOperator from airflow.operators.subdag import SubDagOperator
from airflow.secrets.local_filesystem import LocalFilesystemBackend from airflow.secrets.local_filesystem import LocalFilesystemBackend
from airflow.sensors.base_sensor_operator import BaseSensorOperator
from airflow.triggers.external_task import TaskStateTrigger from airflow.triggers.external_task import TaskStateTrigger
from airflow.utils import dates from airflow.utils import dates
from airflow.utils.dag_cycle_tester import test_cycle from airflow.utils.dag_cycle_tester import test_cycle
@ -40,13 +28,10 @@ from airflow.utils.dates import (
) )
from airflow.utils.db import create_session 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 mkdirs
from airflow.utils.helpers import chain as helper_chain
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 from airflow.www.auth import has_access, has_access_dataset
from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
# airflow root # airflow root
@ -55,11 +40,6 @@ PY36, PY37, PY38, PY39, PY310, PY311, PY312
# airflow.api_connexion.security # airflow.api_connexion.security
requires_access requires_access
# airflow.configuration
get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
# airflow.contrib.* # airflow.contrib.*
AWSAthenaHook() AWSAthenaHook()
@ -68,10 +48,6 @@ AWSAthenaHook()
DatasetAliasEvent() DatasetAliasEvent()
# airflow.hooks
BaseHook()
# airflow.operators.subdag.* # airflow.operators.subdag.*
SubDagOperator() SubDagOperator()
@ -81,10 +57,6 @@ SubDagOperator()
LocalFilesystemBackend() LocalFilesystemBackend()
# airflow.sensors.base_sensor_operator
BaseSensorOperator()
# airflow.triggers.external_task # airflow.triggers.external_task
TaskStateTrigger() TaskStateTrigger()
@ -114,15 +86,8 @@ create_session
apply_defaults apply_defaults
# airflow.utils.file # airflow.utils.file
TemporaryDirectory()
mkdirs mkdirs
# airflow.utils.helpers
helper_chain
helper_cross_downstream
# airflow.utils.log
secrets_masker
# airflow.utils.state # airflow.utils.state
SHUTDOWN SHUTDOWN
@ -135,37 +100,8 @@ TriggerRule.NONE_FAILED_OR_SKIPPED
# airflow.www.auth # airflow.www.auth
has_access has_access
has_access_dataset
# airflow.www.utils # airflow.www.utils
get_sensitive_variables_fields get_sensitive_variables_fields
should_hide_value_for_key should_hide_value_for_key
# airflow.operators.python
from airflow.operators.python import get_current_context
get_current_context()
# airflow.providers.mysql
from airflow.providers.mysql.datasets.mysql import sanitize_uri
sanitize_uri
# airflow.providers.postgres
from airflow.providers.postgres.datasets.postgres import sanitize_uri
sanitize_uri
# airflow.providers.trino
from airflow.providers.trino.datasets.trino import sanitize_uri
sanitize_uri
# airflow.notifications.basenotifier
from airflow.notifications.basenotifier import BaseNotifier
BaseNotifier()
# airflow.auth.manager
from airflow.auth.managers.base_auth_manager import BaseAuthManager
BaseAuthManager()

View File

@ -3,7 +3,6 @@ from __future__ import annotations
from airflow.api_connexion.security import requires_access_dataset from airflow.api_connexion.security import requires_access_dataset
from airflow.auth.managers.models.resource_details import ( from airflow.auth.managers.models.resource_details import (
DatasetDetails, DatasetDetails,
) )
from airflow.datasets.manager import ( from airflow.datasets.manager import (
DatasetManager, DatasetManager,
@ -12,15 +11,13 @@ from airflow.datasets.manager import (
) )
from airflow.lineage.hook import DatasetLineageInfo from airflow.lineage.hook import DatasetLineageInfo
from airflow.metrics.validators import AllowListValidator, BlockListValidator from airflow.metrics.validators import AllowListValidator, BlockListValidator
from airflow.secrets.local_filesystm import load_connections from airflow.secrets.local_filesystem import load_connections
from airflow.security.permissions import RESOURCE_DATASET from airflow.security.permissions import RESOURCE_DATASET
from airflow.www.auth import has_access_dataset
requires_access_dataset() requires_access_dataset()
DatasetDetails() DatasetDetails()
DatasetManager() DatasetManager()
dataset_manager() dataset_manager()
resolve_dataset_manager() resolve_dataset_manager()
@ -34,7 +31,6 @@ load_connections()
RESOURCE_DATASET RESOURCE_DATASET
has_access_dataset()
from airflow.listeners.spec.dataset import ( from airflow.listeners.spec.dataset import (
on_dataset_changed, on_dataset_changed,
@ -43,3 +39,76 @@ from airflow.listeners.spec.dataset import (
on_dataset_created() on_dataset_created()
on_dataset_changed() on_dataset_changed()
# airflow.operators.python
from airflow.operators.python import get_current_context
get_current_context()
# airflow.providers.mysql
from airflow.providers.mysql.datasets.mysql import sanitize_uri
sanitize_uri
# airflow.providers.postgres
from airflow.providers.postgres.datasets.postgres import sanitize_uri
sanitize_uri
# airflow.providers.trino
from airflow.providers.trino.datasets.trino import sanitize_uri
sanitize_uri
# airflow.notifications.basenotifier
from airflow.notifications.basenotifier import BaseNotifier
BaseNotifier()
# airflow.auth.manager
from airflow.auth.managers.base_auth_manager import BaseAuthManager
BaseAuthManager()
from airflow.configuration import (
as_dict,
get,
getboolean,
getfloat,
getint,
has_option,
remove_option,
set,
)
# airflow.configuration
get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
from airflow.hooks.base_hook import BaseHook
# airflow.hooks
BaseHook()
from airflow.sensors.base_sensor_operator import BaseSensorOperator
# airflow.sensors.base_sensor_operator
BaseSensorOperator()
BaseHook()
from airflow.utils.helpers import chain as helper_chain
from airflow.utils.helpers import cross_downstream as helper_cross_downstream
# airflow.utils.helpers
helper_chain
helper_cross_downstream
# airflow.utils.file
from airflow.utils.file import TemporaryDirectory
TemporaryDirectory()
from airflow.utils.log import secrets_masker
# airflow.utils.log
secrets_masker

View File

@ -1,54 +1,54 @@
from __future__ import annotations from __future__ import annotations
from airflow.providers.amazon.aws.auth_manager.avp.entities import AvpEntities from airflow.providers.amazon.aws.auth_manager.avp.entities import AvpEntities
from airflow.providers.openlineage.utils.utils import (
DatasetInfo,
translate_airflow_dataset,
)
from airflow.secrets.local_filesystem import load_connections
from airflow.security.permissions import RESOURCE_DATASET
AvpEntities.DATASET
# airflow.providers.openlineage.utils.utils
DatasetInfo()
translate_airflow_dataset()
# airflow.secrets.local_filesystem
load_connections()
# airflow.security.permissions
RESOURCE_DATASET
from airflow.providers.amazon.aws.datasets.s3 import ( from airflow.providers.amazon.aws.datasets.s3 import (
convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage, convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
) )
from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
s3_create_dataset()
s3_convert_dataset_to_openlineage()
from airflow.providers.common.io.dataset.file import ( from airflow.providers.common.io.dataset.file import (
convert_dataset_to_openlineage as io_convert_dataset_to_openlineage, convert_dataset_to_openlineage as io_convert_dataset_to_openlineage,
) )
from airflow.providers.common.io.dataset.file import create_dataset as io_create_dataset from airflow.providers.common.io.dataset.file import create_dataset as io_create_dataset
from airflow.providers.google.datasets.bigquery import (
create_dataset as bigquery_create_dataset,
)
from airflow.providers.google.datasets.gcs import (
convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
)
from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
from airflow.providers.openlineage.utils.utils import (
DatasetInfo,
translate_airflow_dataset,
)
AvpEntities.DATASET
s3_create_dataset()
s3_convert_dataset_to_openlineage()
io_create_dataset() io_create_dataset()
io_convert_dataset_to_openlineage() io_convert_dataset_to_openlineage()
# # airflow.providers.google.datasets.bigquery
from airflow.providers.google.datasets.bigquery import (
create_dataset as bigquery_create_dataset,
)
# airflow.providers.google.datasets.bigquery
bigquery_create_dataset() bigquery_create_dataset()
# airflow.providers.google.datasets.gcs # airflow.providers.google.datasets.gcs
from airflow.providers.google.datasets.gcs import (
convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
)
from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
gcs_create_dataset() gcs_create_dataset()
gcs_convert_dataset_to_openlineage() gcs_convert_dataset_to_openlineage()
# airflow.providers.openlineage.utils.utils
DatasetInfo()
translate_airflow_dataset()
#
# airflow.secrets.local_filesystem
load_connections()
#
# airflow.security.permissions
RESOURCE_DATASET
# airflow.timetables
DatasetTriggeredTimetable()
#
# airflow.www.auth
has_access_dataset

View File

@ -1,7 +1,7 @@
use crate::checkers::ast::Checker; use crate::checkers::ast::Checker;
use crate::importer::ImportRequest;
use crate::rules::airflow::helpers::{ use crate::rules::airflow::helpers::{
Replacement, is_airflow_builtin_or_provider, is_guarded_by_try_except, Replacement, generate_import_edit, generate_remove_and_runtime_import_edit,
is_airflow_builtin_or_provider, is_guarded_by_try_except,
}; };
use crate::{Edit, Fix, FixAvailability, Violation}; use crate::{Edit, Fix, FixAvailability, Violation};
use ruff_macros::{ViolationMetadata, derive_message_formats}; use ruff_macros::{ViolationMetadata, derive_message_formats};
@ -614,7 +614,6 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
}, },
// airflow.configuration // airflow.configuration
// TODO: check whether we could improve it
[ [
"airflow", "airflow",
"configuration", "configuration",
@ -984,24 +983,19 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
} }
let import_target = name.split('.').next().unwrap_or(name); let import_target = name.split('.').next().unwrap_or(name);
let mut diagnostic = checker.report_diagnostic(
checker
.report_diagnostic(
Airflow3Removal { Airflow3Removal {
deprecated: qualified_name.to_string(), deprecated: qualified_name.to_string(),
replacement: replacement.clone(), replacement: replacement.clone(),
}, },
range, range,
) );
.try_set_fix(|| {
let (import_edit, _) = checker.importer().get_or_import_symbol( if let Some(fix) = generate_import_edit(expr, checker, module, import_target, range)
&ImportRequest::import_from(module, import_target), .or_else(|| generate_remove_and_runtime_import_edit(expr, checker, module, name))
expr.start(), {
checker.semantic(), diagnostic.set_fix(fix);
)?; }
let replacement_edit = Edit::range_replacement(name.to_string(), range);
Ok(Fix::safe_edits(import_edit, [replacement_edit]))
});
} }
/// Check whether a customized Airflow plugin contains removed extensions. /// Check whether a customized Airflow plugin contains removed extensions.

View File

@ -1,651 +1,294 @@
--- ---
source: crates/ruff_linter/src/rules/airflow/mod.rs source: crates/ruff_linter/src/rules/airflow/mod.rs
--- ---
AIR301_names.py:53:1: AIR301 `airflow.PY36` is removed in Airflow 3.0 AIR301_names.py:38:1: AIR301 `airflow.PY36` is removed in Airflow 3.0
| |
52 | # airflow root 37 | # airflow root
53 | PY36, PY37, PY38, PY39, PY310, PY311, PY312 38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^ AIR301 | ^^^^ AIR301
54 | 39 |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
| |
= help: Use `sys.version_info` instead = help: Use `sys.version_info` instead
AIR301_names.py:53:7: AIR301 `airflow.PY37` is removed in Airflow 3.0 AIR301_names.py:38:7: AIR301 `airflow.PY37` is removed in Airflow 3.0
| |
52 | # airflow root 37 | # airflow root
53 | PY36, PY37, PY38, PY39, PY310, PY311, PY312 38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^ AIR301 | ^^^^ AIR301
54 | 39 |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
| |
= help: Use `sys.version_info` instead = help: Use `sys.version_info` instead
AIR301_names.py:53:13: AIR301 `airflow.PY38` is removed in Airflow 3.0 AIR301_names.py:38:13: AIR301 `airflow.PY38` is removed in Airflow 3.0
| |
52 | # airflow root 37 | # airflow root
53 | PY36, PY37, PY38, PY39, PY310, PY311, PY312 38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^ AIR301 | ^^^^ AIR301
54 | 39 |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
| |
= help: Use `sys.version_info` instead = help: Use `sys.version_info` instead
AIR301_names.py:53:19: AIR301 `airflow.PY39` is removed in Airflow 3.0 AIR301_names.py:38:19: AIR301 `airflow.PY39` is removed in Airflow 3.0
| |
52 | # airflow root 37 | # airflow root
53 | PY36, PY37, PY38, PY39, PY310, PY311, PY312 38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^ AIR301 | ^^^^ AIR301
54 | 39 |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
| |
= help: Use `sys.version_info` instead = help: Use `sys.version_info` instead
AIR301_names.py:53:25: AIR301 `airflow.PY310` is removed in Airflow 3.0 AIR301_names.py:38:25: AIR301 `airflow.PY310` is removed in Airflow 3.0
| |
52 | # airflow root 37 | # airflow root
53 | PY36, PY37, PY38, PY39, PY310, PY311, PY312 38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^^ AIR301 | ^^^^^ AIR301
54 | 39 |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
| |
= help: Use `sys.version_info` instead = help: Use `sys.version_info` instead
AIR301_names.py:53:32: AIR301 `airflow.PY311` is removed in Airflow 3.0 AIR301_names.py:38:32: AIR301 `airflow.PY311` is removed in Airflow 3.0
| |
52 | # airflow root 37 | # airflow root
53 | PY36, PY37, PY38, PY39, PY310, PY311, PY312 38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^^ AIR301 | ^^^^^ AIR301
54 | 39 |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
| |
= help: Use `sys.version_info` instead = help: Use `sys.version_info` instead
AIR301_names.py:53:39: AIR301 `airflow.PY312` is removed in Airflow 3.0 AIR301_names.py:38:39: AIR301 `airflow.PY312` is removed in Airflow 3.0
| |
52 | # airflow root 37 | # airflow root
53 | PY36, PY37, PY38, PY39, PY310, PY311, PY312 38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^^ AIR301 | ^^^^^ AIR301
54 | 39 |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
| |
= help: Use `sys.version_info` instead = help: Use `sys.version_info` instead
AIR301_names.py:56:1: AIR301 `airflow.api_connexion.security.requires_access` is removed in Airflow 3.0 AIR301_names.py:41:1: AIR301 `airflow.api_connexion.security.requires_access` is removed in Airflow 3.0
| |
55 | # airflow.api_connexion.security 40 | # airflow.api_connexion.security
56 | requires_access 41 | requires_access
| ^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^ AIR301
42 |
43 | # airflow.contrib.*
| |
= help: Use `airflow.api_fastapi.core_api.security.requires_access_*` instead = help: Use `airflow.api_fastapi.core_api.security.requires_access_*` instead
AIR301_names.py:60:1: AIR301 [*] `airflow.configuration.get` is removed in Airflow 3.0 AIR301_names.py:44:1: AIR301 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is removed in Airflow 3.0
| |
59 | # airflow.configuration 43 | # airflow.contrib.*
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set 44 | AWSAthenaHook()
| ^^^ AIR301
|
= help: Use `conf.get` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+conf.get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:60:6: AIR301 [*] `airflow.configuration.getboolean` is removed in Airflow 3.0
|
59 | # airflow.configuration
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^^^ AIR301
|
= help: Use `conf.getboolean` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+get, conf.getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:60:18: AIR301 [*] `airflow.configuration.getfloat` is removed in Airflow 3.0
|
59 | # airflow.configuration
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^ AIR301
|
= help: Use `conf.getfloat` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+get, getboolean, conf.getfloat, getint, has_option, remove_option, as_dict, set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:60:28: AIR301 [*] `airflow.configuration.getint` is removed in Airflow 3.0
|
59 | # airflow.configuration
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^ AIR301
|
= help: Use `conf.getint` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+get, getboolean, getfloat, conf.getint, has_option, remove_option, as_dict, set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:60:36: AIR301 [*] `airflow.configuration.has_option` is removed in Airflow 3.0
|
59 | # airflow.configuration
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^^^ AIR301
|
= help: Use `conf.has_option` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+get, getboolean, getfloat, getint, conf.has_option, remove_option, as_dict, set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:60:48: AIR301 [*] `airflow.configuration.remove_option` is removed in Airflow 3.0
|
59 | # airflow.configuration
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^^^^^^ AIR301
|
= help: Use `conf.remove_option` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+get, getboolean, getfloat, getint, has_option, conf.remove_option, as_dict, set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:60:63: AIR301 [*] `airflow.configuration.as_dict` is removed in Airflow 3.0
|
59 | # airflow.configuration
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^ AIR301
|
= help: Use `conf.as_dict` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+get, getboolean, getfloat, getint, has_option, remove_option, conf.as_dict, set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:60:72: AIR301 [*] `airflow.configuration.set` is removed in Airflow 3.0
|
59 | # airflow.configuration
60 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^ AIR301
|
= help: Use `conf.set` from `airflow.configuration` instead.
Safe fix
19 19 | has_option,
20 20 | remove_option,
21 21 | set,
22 |+conf,
22 23 | )
23 24 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
24 25 | from airflow.datasets import DatasetAliasEvent
--------------------------------------------------------------------------------
57 58 |
58 59 |
59 60 | # airflow.configuration
60 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
61 |+get, getboolean, getfloat, getint, has_option, remove_option, as_dict, conf.set
61 62 |
62 63 |
63 64 | # airflow.contrib.*
AIR301_names.py:64:1: AIR301 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is removed in Airflow 3.0
|
63 | # airflow.contrib.*
64 | AWSAthenaHook()
| ^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^ AIR301
| |
= help: The whole `airflow.contrib` module has been removed. = help: The whole `airflow.contrib` module has been removed.
AIR301_names.py:68:1: AIR301 `airflow.datasets.DatasetAliasEvent` is removed in Airflow 3.0 AIR301_names.py:48:1: AIR301 `airflow.datasets.DatasetAliasEvent` is removed in Airflow 3.0
| |
67 | # airflow.datasets 47 | # airflow.datasets
68 | DatasetAliasEvent() 48 | DatasetAliasEvent()
| ^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^ AIR301
| |
AIR301_names.py:72:1: AIR301 `airflow.hooks.base_hook.BaseHook` is removed in Airflow 3.0 AIR301_names.py:52:1: AIR301 `airflow.operators.subdag.SubDagOperator` is removed in Airflow 3.0
| |
71 | # airflow.hooks 51 | # airflow.operators.subdag.*
72 | BaseHook() 52 | SubDagOperator()
| ^^^^^^^^ AIR301
|
= help: Use `BaseHook` from `airflow.hooks.base` instead.
AIR301_names.py:76:1: AIR301 `airflow.operators.subdag.SubDagOperator` is removed in Airflow 3.0
|
75 | # airflow.operators.subdag.*
76 | SubDagOperator()
| ^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^ AIR301
| |
= help: The whole `airflow.subdag` module has been removed. = help: The whole `airflow.subdag` module has been removed.
AIR301_names.py:85:1: AIR301 `airflow.sensors.base_sensor_operator.BaseSensorOperator` is removed in Airflow 3.0 AIR301_names.py:61:1: AIR301 `airflow.triggers.external_task.TaskStateTrigger` is removed in Airflow 3.0
| |
84 | # airflow.sensors.base_sensor_operator 60 | # airflow.triggers.external_task
85 | BaseSensorOperator() 61 | TaskStateTrigger()
| ^^^^^^^^^^^^^^^^^^ AIR301
|
= help: Use `BaseSensorOperator` from `airflow.sdk.bases.sensor` instead.
AIR301_names.py:89:1: AIR301 `airflow.triggers.external_task.TaskStateTrigger` is removed in Airflow 3.0
|
88 | # airflow.triggers.external_task
89 | TaskStateTrigger()
| ^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^ AIR301
90 | 62 |
91 | # airflow.utils.date 63 | # airflow.utils.date
| |
AIR301_names.py:92:1: AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0 AIR301_names.py:64:1: AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0
| |
91 | # airflow.utils.date 63 | # airflow.utils.date
92 | dates.date_range 64 | dates.date_range
| ^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^ AIR301
93 | dates.days_ago 65 | dates.days_ago
| |
AIR301_names.py:93:1: AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0 AIR301_names.py:65:1: AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
| |
91 | # airflow.utils.date 63 | # airflow.utils.date
92 | dates.date_range 64 | dates.date_range
93 | dates.days_ago 65 | dates.days_ago
| ^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^ AIR301
94 | 66 |
95 | date_range 67 | date_range
| |
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead = help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR301_names.py:95:1: AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0 AIR301_names.py:67:1: AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0
| |
93 | dates.days_ago 65 | dates.days_ago
94 | 66 |
95 | date_range 67 | date_range
| ^^^^^^^^^^ AIR301 | ^^^^^^^^^^ AIR301
96 | days_ago 68 | days_ago
97 | infer_time_unit 69 | infer_time_unit
| |
AIR301_names.py:96:1: AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0 AIR301_names.py:68:1: AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
| |
95 | date_range 67 | date_range
96 | days_ago 68 | days_ago
| ^^^^^^^^ AIR301 | ^^^^^^^^ AIR301
97 | infer_time_unit 69 | infer_time_unit
98 | parse_execution_date 70 | parse_execution_date
| |
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead = help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
AIR301_names.py:97:1: AIR301 `airflow.utils.dates.infer_time_unit` is removed in Airflow 3.0 AIR301_names.py:69:1: AIR301 `airflow.utils.dates.infer_time_unit` is removed in Airflow 3.0
| |
95 | date_range 67 | date_range
96 | days_ago 68 | days_ago
97 | infer_time_unit 69 | infer_time_unit
| ^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^ AIR301
98 | parse_execution_date 70 | parse_execution_date
99 | round_time 71 | round_time
| |
AIR301_names.py:98:1: AIR301 `airflow.utils.dates.parse_execution_date` is removed in Airflow 3.0 AIR301_names.py:70:1: AIR301 `airflow.utils.dates.parse_execution_date` is removed in Airflow 3.0
| |
96 | days_ago 68 | days_ago
97 | infer_time_unit 69 | infer_time_unit
98 | parse_execution_date 70 | parse_execution_date
| ^^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^^ AIR301
99 | round_time 71 | round_time
100 | scale_time_units 72 | scale_time_units
| |
AIR301_names.py:99:1: AIR301 `airflow.utils.dates.round_time` is removed in Airflow 3.0 AIR301_names.py:71:1: AIR301 `airflow.utils.dates.round_time` is removed in Airflow 3.0
| |
97 | infer_time_unit 69 | infer_time_unit
98 | parse_execution_date 70 | parse_execution_date
99 | round_time 71 | round_time
| ^^^^^^^^^^ AIR301 | ^^^^^^^^^^ AIR301
100 | scale_time_units 72 | scale_time_units
| |
AIR301_names.py:100:1: AIR301 `airflow.utils.dates.scale_time_units` is removed in Airflow 3.0 AIR301_names.py:72:1: AIR301 `airflow.utils.dates.scale_time_units` is removed in Airflow 3.0
| |
98 | parse_execution_date 70 | parse_execution_date
99 | round_time 71 | round_time
100 | scale_time_units 72 | scale_time_units
| ^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^ AIR301
101 | 73 |
102 | # This one was not deprecated. 74 | # This one was not deprecated.
| |
AIR301_names.py:107:1: AIR301 `airflow.utils.dag_cycle_tester.test_cycle` is removed in Airflow 3.0 AIR301_names.py:79:1: AIR301 `airflow.utils.dag_cycle_tester.test_cycle` is removed in Airflow 3.0
| |
106 | # airflow.utils.dag_cycle_tester 78 | # airflow.utils.dag_cycle_tester
107 | test_cycle 79 | test_cycle
| ^^^^^^^^^^ AIR301 | ^^^^^^^^^^ AIR301
| |
AIR301_names.py:111:1: AIR301 `airflow.utils.db.create_session` is removed in Airflow 3.0 AIR301_names.py:83:1: AIR301 `airflow.utils.db.create_session` is removed in Airflow 3.0
| |
110 | # airflow.utils.db 82 | # airflow.utils.db
111 | create_session 83 | create_session
| ^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^ AIR301
112 | 84 |
113 | # airflow.utils.decorators 85 | # airflow.utils.decorators
| |
AIR301_names.py:114:1: AIR301 `airflow.utils.decorators.apply_defaults` is removed in Airflow 3.0 AIR301_names.py:86:1: AIR301 `airflow.utils.decorators.apply_defaults` is removed in Airflow 3.0
| |
113 | # airflow.utils.decorators 85 | # airflow.utils.decorators
114 | apply_defaults 86 | apply_defaults
| ^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^ AIR301
115 | 87 |
116 | # airflow.utils.file 88 | # airflow.utils.file
| |
= help: `apply_defaults` is now unconditionally done and can be safely removed. = help: `apply_defaults` is now unconditionally done and can be safely removed.
AIR301_names.py:117:1: AIR301 `airflow.utils.file.TemporaryDirectory` is removed in Airflow 3.0 AIR301_names.py:89:1: AIR301 `airflow.utils.file.mkdirs` is removed in Airflow 3.0
| |
116 | # airflow.utils.file 88 | # airflow.utils.file
117 | TemporaryDirectory() 89 | mkdirs
| ^^^^^^^^^^^^^^^^^^ AIR301
118 | mkdirs
|
= help: Use `TemporaryDirectory` from `tempfile` instead.
AIR301_names.py:118:1: AIR301 `airflow.utils.file.mkdirs` is removed in Airflow 3.0
|
116 | # airflow.utils.file
117 | TemporaryDirectory()
118 | mkdirs
| ^^^^^^ AIR301 | ^^^^^^ AIR301
119 |
120 | # airflow.utils.helpers
| |
= help: Use `pathlib.Path({path}).mkdir` instead = help: Use `pathlib.Path({path}).mkdir` instead
AIR301_names.py:121:1: AIR301 [*] `airflow.utils.helpers.chain` is removed in Airflow 3.0 AIR301_names.py:93:1: AIR301 `airflow.utils.state.SHUTDOWN` is removed in Airflow 3.0
| |
120 | # airflow.utils.helpers 92 | # airflow.utils.state
121 | helper_chain 93 | SHUTDOWN
| ^^^^^^^^^^^^ AIR301
122 | helper_cross_downstream
|
= help: Use `chain` from `airflow.sdk` instead.
Safe fix
48 48 | from airflow.utils.trigger_rule import TriggerRule
49 49 | from airflow.www.auth import has_access
50 50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |+from airflow.sdk import chain
51 52 |
52 53 | # airflow root
53 54 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
--------------------------------------------------------------------------------
118 119 | mkdirs
119 120 |
120 121 | # airflow.utils.helpers
121 |-helper_chain
122 |+chain
122 123 | helper_cross_downstream
123 124 |
124 125 | # airflow.utils.log
AIR301_names.py:122:1: AIR301 [*] `airflow.utils.helpers.cross_downstream` is removed in Airflow 3.0
|
120 | # airflow.utils.helpers
121 | helper_chain
122 | helper_cross_downstream
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
123 |
124 | # airflow.utils.log
|
= help: Use `cross_downstream` from `airflow.sdk` instead.
Safe fix
48 48 | from airflow.utils.trigger_rule import TriggerRule
49 49 | from airflow.www.auth import has_access
50 50 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
51 |+from airflow.sdk import cross_downstream
51 52 |
52 53 | # airflow root
53 54 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
--------------------------------------------------------------------------------
119 120 |
120 121 | # airflow.utils.helpers
121 122 | helper_chain
122 |-helper_cross_downstream
123 |+cross_downstream
123 124 |
124 125 | # airflow.utils.log
125 126 | secrets_masker
AIR301_names.py:125:1: AIR301 `airflow.utils.log.secrets_masker` is removed in Airflow 3.0
|
124 | # airflow.utils.log
125 | secrets_masker
| ^^^^^^^^^^^^^^ AIR301
126 |
127 | # airflow.utils.state
|
= help: Use `secrets_masker` from `airflow.sdk.execution_time` instead.
AIR301_names.py:128:1: AIR301 `airflow.utils.state.SHUTDOWN` is removed in Airflow 3.0
|
127 | # airflow.utils.state
128 | SHUTDOWN
| ^^^^^^^^ AIR301 | ^^^^^^^^ AIR301
129 | terminating_states 94 | terminating_states
| |
AIR301_names.py:129:1: AIR301 `airflow.utils.state.terminating_states` is removed in Airflow 3.0 AIR301_names.py:94:1: AIR301 `airflow.utils.state.terminating_states` is removed in Airflow 3.0
| |
127 | # airflow.utils.state 92 | # airflow.utils.state
128 | SHUTDOWN 93 | SHUTDOWN
129 | terminating_states 94 | terminating_states
| ^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^ AIR301
130 | 95 |
131 | # airflow.utils.trigger_rule 96 | # airflow.utils.trigger_rule
| |
AIR301_names.py:132:1: AIR301 `airflow.utils.trigger_rule.TriggerRule.DUMMY` is removed in Airflow 3.0 AIR301_names.py:97:1: AIR301 `airflow.utils.trigger_rule.TriggerRule.DUMMY` is removed in Airflow 3.0
| |
131 | # airflow.utils.trigger_rule 96 | # airflow.utils.trigger_rule
132 | TriggerRule.DUMMY 97 | TriggerRule.DUMMY
| ^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^ AIR301
133 | TriggerRule.NONE_FAILED_OR_SKIPPED 98 | TriggerRule.NONE_FAILED_OR_SKIPPED
| |
AIR301_names.py:133:1: AIR301 `airflow.utils.trigger_rule.TriggerRule.NONE_FAILED_OR_SKIPPED` is removed in Airflow 3.0 AIR301_names.py:98:1: AIR301 `airflow.utils.trigger_rule.TriggerRule.NONE_FAILED_OR_SKIPPED` is removed in Airflow 3.0
| |
131 | # airflow.utils.trigger_rule 96 | # airflow.utils.trigger_rule
132 | TriggerRule.DUMMY 97 | TriggerRule.DUMMY
133 | TriggerRule.NONE_FAILED_OR_SKIPPED 98 | TriggerRule.NONE_FAILED_OR_SKIPPED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
| |
AIR301_names.py:137:1: AIR301 `airflow.www.auth.has_access` is removed in Airflow 3.0 AIR301_names.py:102:1: AIR301 `airflow.www.auth.has_access` is removed in Airflow 3.0
| |
136 | # airflow.www.auth 101 | # airflow.www.auth
137 | has_access 102 | has_access
| ^^^^^^^^^^ AIR301 | ^^^^^^^^^^ AIR301
138 | 103 | has_access_dataset
139 | # airflow.www.utils
| |
AIR301_names.py:140:1: AIR301 `airflow.www.utils.get_sensitive_variables_fields` is removed in Airflow 3.0 AIR301_names.py:103:1: AIR301 `airflow.www.auth.has_access_dataset` is removed in Airflow 3.0
| |
139 | # airflow.www.utils 101 | # airflow.www.auth
140 | get_sensitive_variables_fields 102 | has_access
103 | has_access_dataset
| ^^^^^^^^^^^^^^^^^^ AIR301
104 |
105 | # airflow.www.utils
|
AIR301_names.py:106:1: AIR301 `airflow.www.utils.get_sensitive_variables_fields` is removed in Airflow 3.0
|
105 | # airflow.www.utils
106 | get_sensitive_variables_fields
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
141 | should_hide_value_for_key 107 | should_hide_value_for_key
| |
AIR301_names.py:141:1: AIR301 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0 AIR301_names.py:107:1: AIR301 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0
| |
139 | # airflow.www.utils 105 | # airflow.www.utils
140 | get_sensitive_variables_fields 106 | get_sensitive_variables_fields
141 | should_hide_value_for_key 107 | should_hide_value_for_key
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
142 |
143 | # airflow.operators.python
| |
AIR301_names.py:146:1: AIR301 `airflow.operators.python.get_current_context` is removed in Airflow 3.0
|
144 | from airflow.operators.python import get_current_context
145 |
146 | get_current_context()
| ^^^^^^^^^^^^^^^^^^^ AIR301
147 |
148 | # airflow.providers.mysql
|
= help: Use `get_current_context` from `airflow.sdk` instead.
AIR301_names.py:151:1: AIR301 `airflow.providers.mysql.datasets.mysql.sanitize_uri` is removed in Airflow 3.0
|
149 | from airflow.providers.mysql.datasets.mysql import sanitize_uri
150 |
151 | sanitize_uri
| ^^^^^^^^^^^^ AIR301
152 |
153 | # airflow.providers.postgres
|
= help: Use `sanitize_uri` from `airflow.providers.mysql.assets.mysql` instead.
AIR301_names.py:156:1: AIR301 `airflow.providers.postgres.datasets.postgres.sanitize_uri` is removed in Airflow 3.0
|
154 | from airflow.providers.postgres.datasets.postgres import sanitize_uri
155 |
156 | sanitize_uri
| ^^^^^^^^^^^^ AIR301
157 |
158 | # airflow.providers.trino
|
= help: Use `sanitize_uri` from `airflow.providers.postgres.assets.postgres` instead.
AIR301_names.py:161:1: AIR301 `airflow.providers.trino.datasets.trino.sanitize_uri` is removed in Airflow 3.0
|
159 | from airflow.providers.trino.datasets.trino import sanitize_uri
160 |
161 | sanitize_uri
| ^^^^^^^^^^^^ AIR301
162 |
163 | # airflow.notifications.basenotifier
|
= help: Use `sanitize_uri` from `airflow.providers.trino.assets.trino` instead.
AIR301_names.py:166:1: AIR301 `airflow.notifications.basenotifier.BaseNotifier` is removed in Airflow 3.0
|
164 | from airflow.notifications.basenotifier import BaseNotifier
165 |
166 | BaseNotifier()
| ^^^^^^^^^^^^ AIR301
167 |
168 | # airflow.auth.manager
|
= help: Use `BaseNotifier` from `airflow.sdk.bases.notifier` instead.
AIR301_names.py:171:1: AIR301 `airflow.auth.managers.base_auth_manager.BaseAuthManager` is removed in Airflow 3.0
|
169 | from airflow.auth.managers.base_auth_manager import BaseAuthManager
170 |
171 | BaseAuthManager()
| ^^^^^^^^^^^^^^^ AIR301
|
= help: Use `BaseAuthManager` from `airflow.api_fastapi.auth.managers.base_auth_manager` instead.

View File

@ -1,296 +1,780 @@
--- ---
source: crates/ruff_linter/src/rules/airflow/mod.rs source: crates/ruff_linter/src/rules/airflow/mod.rs
--- ---
AIR301_names_fix.py:19:1: AIR301 [*] `airflow.api_connexion.security.requires_access_dataset` is removed in Airflow 3.0 AIR301_names_fix.py:17:1: AIR301 [*] `airflow.api_connexion.security.requires_access_dataset` is removed in Airflow 3.0
| |
17 | from airflow.www.auth import has_access_dataset 15 | from airflow.security.permissions import RESOURCE_DATASET
18 | 16 |
19 | requires_access_dataset() 17 | requires_access_dataset()
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
20 | 18 |
21 | DatasetDetails() 19 | DatasetDetails()
| |
= help: Use `requires_access_asset` from `airflow.api_fastapi.core_api.security` instead. = help: Use `requires_access_asset` from `airflow.api_fastapi.core_api.security` instead.
Safe fix Safe fix
15 15 | from airflow.secrets.local_filesystm import load_connections 13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
16 16 | from airflow.security.permissions import RESOURCE_DATASET 14 14 | from airflow.secrets.local_filesystem import load_connections
17 17 | from airflow.www.auth import has_access_dataset 15 15 | from airflow.security.permissions import RESOURCE_DATASET
18 |+from airflow.api_fastapi.core_api.security import requires_access_asset 16 |+from airflow.api_fastapi.core_api.security import requires_access_asset
16 17 |
17 |-requires_access_dataset()
18 |+requires_access_asset()
18 19 | 18 19 |
19 |-requires_access_dataset() 19 20 | DatasetDetails()
20 |+requires_access_asset()
20 21 | 20 21 |
21 22 | DatasetDetails()
22 23 |
AIR301_names_fix.py:21:1: AIR301 [*] `airflow.auth.managers.models.resource_details.DatasetDetails` is removed in Airflow 3.0 AIR301_names_fix.py:19:1: AIR301 [*] `airflow.auth.managers.models.resource_details.DatasetDetails` is removed in Airflow 3.0
| |
19 | requires_access_dataset() 17 | requires_access_dataset()
20 | 18 |
21 | DatasetDetails() 19 | DatasetDetails()
| ^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^ AIR301
20 |
21 | DatasetManager()
| |
= help: Use `AssetDetails` from `airflow.api_fastapi.auth.managers.models.resource_details` instead. = help: Use `AssetDetails` from `airflow.api_fastapi.auth.managers.models.resource_details` instead.
Safe fix Safe fix
15 15 | from airflow.secrets.local_filesystm import load_connections 13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
16 16 | from airflow.security.permissions import RESOURCE_DATASET 14 14 | from airflow.secrets.local_filesystem import load_connections
17 17 | from airflow.www.auth import has_access_dataset 15 15 | from airflow.security.permissions import RESOURCE_DATASET
18 |+from airflow.api_fastapi.auth.managers.models.resource_details import AssetDetails 16 |+from airflow.api_fastapi.auth.managers.models.resource_details import AssetDetails
16 17 |
17 18 | requires_access_dataset()
18 19 | 18 19 |
19 20 | requires_access_dataset() 19 |-DatasetDetails()
20 |+AssetDetails()
20 21 | 20 21 |
21 |-DatasetDetails() 21 22 | DatasetManager()
22 |+AssetDetails() 22 23 | dataset_manager()
22 23 |
23 24 |
24 25 | DatasetManager()
AIR301_names_fix.py:24:1: AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0 AIR301_names_fix.py:21:1: AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0
| |
24 | DatasetManager() 19 | DatasetDetails()
20 |
21 | DatasetManager()
| ^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^ AIR301
25 | dataset_manager() 22 | dataset_manager()
26 | resolve_dataset_manager() 23 | resolve_dataset_manager()
| |
= help: Use `AssetManager` from `airflow.assets.manager` instead. = help: Use `AssetManager` from `airflow.assets.manager` instead.
Safe fix Safe fix
15 15 | from airflow.secrets.local_filesystm import load_connections 13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
16 16 | from airflow.security.permissions import RESOURCE_DATASET 14 14 | from airflow.secrets.local_filesystem import load_connections
17 17 | from airflow.www.auth import has_access_dataset 15 15 | from airflow.security.permissions import RESOURCE_DATASET
18 |+from airflow.assets.manager import AssetManager 16 |+from airflow.assets.manager import AssetManager
16 17 |
17 18 | requires_access_dataset()
18 19 | 18 19 |
19 20 | requires_access_dataset() 19 20 | DatasetDetails()
20 21 | 20 21 |
21 22 | DatasetDetails() 21 |-DatasetManager()
22 23 | 22 |+AssetManager()
23 24 | 22 23 | dataset_manager()
24 |-DatasetManager() 23 24 | resolve_dataset_manager()
25 |+AssetManager() 24 25 |
25 26 | dataset_manager()
26 27 | resolve_dataset_manager()
27 28 |
AIR301_names_fix.py:25:1: AIR301 [*] `airflow.datasets.manager.dataset_manager` is removed in Airflow 3.0 AIR301_names_fix.py:22:1: AIR301 [*] `airflow.datasets.manager.dataset_manager` is removed in Airflow 3.0
| |
24 | DatasetManager() 21 | DatasetManager()
25 | dataset_manager() 22 | dataset_manager()
| ^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^ AIR301
26 | resolve_dataset_manager() 23 | resolve_dataset_manager()
| |
= help: Use `asset_manager` from `airflow.assets.manager` instead. = help: Use `asset_manager` from `airflow.assets.manager` instead.
Safe fix Safe fix
15 15 | from airflow.secrets.local_filesystm import load_connections 13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
16 16 | from airflow.security.permissions import RESOURCE_DATASET 14 14 | from airflow.secrets.local_filesystem import load_connections
17 17 | from airflow.www.auth import has_access_dataset 15 15 | from airflow.security.permissions import RESOURCE_DATASET
18 |+from airflow.assets.manager import asset_manager 16 |+from airflow.assets.manager import asset_manager
16 17 |
17 18 | requires_access_dataset()
18 19 | 18 19 |
19 20 | requires_access_dataset() 19 20 | DatasetDetails()
20 21 | 20 21 |
-------------------------------------------------------------------------------- 21 22 | DatasetManager()
22 23 | 22 |-dataset_manager()
23 24 | 23 |+asset_manager()
24 25 | DatasetManager() 23 24 | resolve_dataset_manager()
25 |-dataset_manager() 24 25 |
26 |+asset_manager() 25 26 | DatasetLineageInfo()
26 27 | resolve_dataset_manager()
27 28 |
28 29 | DatasetLineageInfo()
AIR301_names_fix.py:26:1: AIR301 [*] `airflow.datasets.manager.resolve_dataset_manager` is removed in Airflow 3.0 AIR301_names_fix.py:23:1: AIR301 [*] `airflow.datasets.manager.resolve_dataset_manager` is removed in Airflow 3.0
| |
24 | DatasetManager() 21 | DatasetManager()
25 | dataset_manager() 22 | dataset_manager()
26 | resolve_dataset_manager() 23 | resolve_dataset_manager()
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
27 | 24 |
28 | DatasetLineageInfo() 25 | DatasetLineageInfo()
| |
= help: Use `resolve_asset_manager` from `airflow.assets.manager` instead. = help: Use `resolve_asset_manager` from `airflow.assets.manager` instead.
Safe fix Safe fix
15 15 | from airflow.secrets.local_filesystm import load_connections 13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
16 16 | from airflow.security.permissions import RESOURCE_DATASET 14 14 | from airflow.secrets.local_filesystem import load_connections
17 17 | from airflow.www.auth import has_access_dataset 15 15 | from airflow.security.permissions import RESOURCE_DATASET
18 |+from airflow.assets.manager import resolve_asset_manager 16 |+from airflow.assets.manager import resolve_asset_manager
16 17 |
17 18 | requires_access_dataset()
18 19 | 18 19 |
19 20 | requires_access_dataset()
20 21 |
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
23 24 | 20 21 |
24 25 | DatasetManager() 21 22 | DatasetManager()
25 26 | dataset_manager() 22 23 | dataset_manager()
26 |-resolve_dataset_manager() 23 |-resolve_dataset_manager()
27 |+resolve_asset_manager() 24 |+resolve_asset_manager()
27 28 | 24 25 |
28 29 | DatasetLineageInfo() 25 26 | DatasetLineageInfo()
29 30 | 26 27 |
AIR301_names_fix.py:28:1: AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0 AIR301_names_fix.py:25:1: AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
| |
26 | resolve_dataset_manager() 23 | resolve_dataset_manager()
27 | 24 |
28 | DatasetLineageInfo() 25 | DatasetLineageInfo()
| ^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^ AIR301
29 | 26 |
30 | AllowListValidator() 27 | AllowListValidator()
| |
= help: Use `AssetLineageInfo` from `airflow.lineage.hook` instead. = help: Use `AssetLineageInfo` from `airflow.lineage.hook` instead.
Safe fix Safe fix
10 10 | dataset_manager, 9 9 | dataset_manager,
11 11 | resolve_dataset_manager, 10 10 | resolve_dataset_manager,
12 12 | ) 11 11 | )
13 |-from airflow.lineage.hook import DatasetLineageInfo 12 |-from airflow.lineage.hook import DatasetLineageInfo
13 |+from airflow.lineage.hook import DatasetLineageInfo, AssetLineageInfo 12 |+from airflow.lineage.hook import DatasetLineageInfo, AssetLineageInfo
14 14 | from airflow.metrics.validators import AllowListValidator, BlockListValidator 13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
15 15 | from airflow.secrets.local_filesystm import load_connections 14 14 | from airflow.secrets.local_filesystem import load_connections
16 16 | from airflow.security.permissions import RESOURCE_DATASET 15 15 | from airflow.security.permissions import RESOURCE_DATASET
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
25 25 | dataset_manager() 22 22 | dataset_manager()
26 26 | resolve_dataset_manager() 23 23 | resolve_dataset_manager()
27 27 | 24 24 |
28 |-DatasetLineageInfo() 25 |-DatasetLineageInfo()
28 |+AssetLineageInfo() 25 |+AssetLineageInfo()
29 29 | 26 26 |
30 30 | AllowListValidator() 27 27 | AllowListValidator()
31 31 | BlockListValidator() 28 28 | BlockListValidator()
AIR301_names_fix.py:30:1: AIR301 [*] `airflow.metrics.validators.AllowListValidator` is removed in Airflow 3.0 AIR301_names_fix.py:27:1: AIR301 [*] `airflow.metrics.validators.AllowListValidator` is removed in Airflow 3.0
| |
28 | DatasetLineageInfo() 25 | DatasetLineageInfo()
29 | 26 |
30 | AllowListValidator() 27 | AllowListValidator()
| ^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^ AIR301
31 | BlockListValidator() 28 | BlockListValidator()
| |
= help: Use `PatternAllowListValidator` from `airflow.metrics.validators` instead. = help: Use `PatternAllowListValidator` from `airflow.metrics.validators` instead.
Safe fix Safe fix
11 11 | resolve_dataset_manager, 10 10 | resolve_dataset_manager,
12 12 | ) 11 11 | )
13 13 | from airflow.lineage.hook import DatasetLineageInfo 12 12 | from airflow.lineage.hook import DatasetLineageInfo
14 |-from airflow.metrics.validators import AllowListValidator, BlockListValidator 13 |-from airflow.metrics.validators import AllowListValidator, BlockListValidator
14 |+from airflow.metrics.validators import AllowListValidator, BlockListValidator, PatternAllowListValidator 13 |+from airflow.metrics.validators import AllowListValidator, BlockListValidator, PatternAllowListValidator
15 15 | from airflow.secrets.local_filesystm import load_connections 14 14 | from airflow.secrets.local_filesystem import load_connections
16 16 | from airflow.security.permissions import RESOURCE_DATASET 15 15 | from airflow.security.permissions import RESOURCE_DATASET
17 17 | from airflow.www.auth import has_access_dataset 16 16 |
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
27 27 | 24 24 |
28 28 | DatasetLineageInfo() 25 25 | DatasetLineageInfo()
26 26 |
27 |-AllowListValidator()
27 |+PatternAllowListValidator()
28 28 | BlockListValidator()
29 29 | 29 29 |
30 |-AllowListValidator() 30 30 | load_connections()
30 |+PatternAllowListValidator()
31 31 | BlockListValidator()
32 32 |
33 33 | load_connections()
AIR301_names_fix.py:31:1: AIR301 [*] `airflow.metrics.validators.BlockListValidator` is removed in Airflow 3.0 AIR301_names_fix.py:28:1: AIR301 [*] `airflow.metrics.validators.BlockListValidator` is removed in Airflow 3.0
| |
30 | AllowListValidator() 27 | AllowListValidator()
31 | BlockListValidator() 28 | BlockListValidator()
| ^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^ AIR301
32 | 29 |
33 | load_connections() 30 | load_connections()
| |
= help: Use `PatternBlockListValidator` from `airflow.metrics.validators` instead. = help: Use `PatternBlockListValidator` from `airflow.metrics.validators` instead.
Safe fix Safe fix
11 11 | resolve_dataset_manager, 10 10 | resolve_dataset_manager,
12 12 | ) 11 11 | )
13 13 | from airflow.lineage.hook import DatasetLineageInfo 12 12 | from airflow.lineage.hook import DatasetLineageInfo
14 |-from airflow.metrics.validators import AllowListValidator, BlockListValidator 13 |-from airflow.metrics.validators import AllowListValidator, BlockListValidator
14 |+from airflow.metrics.validators import AllowListValidator, BlockListValidator, PatternBlockListValidator 13 |+from airflow.metrics.validators import AllowListValidator, BlockListValidator, PatternBlockListValidator
15 15 | from airflow.secrets.local_filesystm import load_connections 14 14 | from airflow.secrets.local_filesystem import load_connections
16 16 | from airflow.security.permissions import RESOURCE_DATASET 15 15 | from airflow.security.permissions import RESOURCE_DATASET
17 17 | from airflow.www.auth import has_access_dataset 16 16 |
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
28 28 | DatasetLineageInfo() 25 25 | DatasetLineageInfo()
26 26 |
27 27 | AllowListValidator()
28 |-BlockListValidator()
28 |+PatternBlockListValidator()
29 29 | 29 29 |
30 30 | AllowListValidator() 30 30 | load_connections()
31 |-BlockListValidator() 31 31 |
31 |+PatternBlockListValidator()
32 32 |
33 33 | load_connections()
34 34 |
AIR301_names_fix.py:35:1: AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0 AIR301_names_fix.py:30:1: AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
| |
33 | load_connections() 28 | BlockListValidator()
34 | 29 |
35 | RESOURCE_DATASET 30 | load_connections()
| ^^^^^^^^^^^^^^^^ AIR301
31 |
32 | RESOURCE_DATASET
|
= help: Use `load_connections_dict` from `airflow.secrets.local_filesystem` instead.
Safe fix
11 11 | )
12 12 | from airflow.lineage.hook import DatasetLineageInfo
13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
14 |-from airflow.secrets.local_filesystem import load_connections
14 |+from airflow.secrets.local_filesystem import load_connections, load_connections_dict
15 15 | from airflow.security.permissions import RESOURCE_DATASET
16 16 |
17 17 | requires_access_dataset()
--------------------------------------------------------------------------------
27 27 | AllowListValidator()
28 28 | BlockListValidator()
29 29 |
30 |-load_connections()
30 |+load_connections_dict()
31 31 |
32 32 | RESOURCE_DATASET
33 33 |
AIR301_names_fix.py:32:1: AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0
|
30 | load_connections()
31 |
32 | RESOURCE_DATASET
| ^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^ AIR301
36 |
37 | has_access_dataset()
| |
= help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead. = help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead.
Safe fix Safe fix
13 13 | from airflow.lineage.hook import DatasetLineageInfo 12 12 | from airflow.lineage.hook import DatasetLineageInfo
14 14 | from airflow.metrics.validators import AllowListValidator, BlockListValidator 13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
15 15 | from airflow.secrets.local_filesystm import load_connections 14 14 | from airflow.secrets.local_filesystem import load_connections
16 |-from airflow.security.permissions import RESOURCE_DATASET 15 |-from airflow.security.permissions import RESOURCE_DATASET
16 |+from airflow.security.permissions import RESOURCE_DATASET, RESOURCE_ASSET 15 |+from airflow.security.permissions import RESOURCE_DATASET, RESOURCE_ASSET
17 17 | from airflow.www.auth import has_access_dataset 16 16 |
17 17 | requires_access_dataset()
18 18 | 18 18 |
19 19 | requires_access_dataset()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
32 32 | 29 29 |
33 33 | load_connections() 30 30 | load_connections()
31 31 |
32 |-RESOURCE_DATASET
32 |+RESOURCE_ASSET
33 33 |
34 34 | 34 34 |
35 |-RESOURCE_DATASET 35 35 | from airflow.listeners.spec.dataset import (
35 |+RESOURCE_ASSET
36 36 |
37 37 | has_access_dataset()
38 38 |
AIR301_names_fix.py:37:1: AIR301 `airflow.www.auth.has_access_dataset` is removed in Airflow 3.0 AIR301_names_fix.py:40:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_created` is removed in Airflow 3.0
| |
35 | RESOURCE_DATASET 38 | )
36 | 39 |
37 | has_access_dataset() 40 | on_dataset_created()
| ^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^ AIR301
38 | 41 | on_dataset_changed()
39 | from airflow.listeners.spec.dataset import (
|
AIR301_names_fix.py:44:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_created` is removed in Airflow 3.0
|
42 | )
43 |
44 | on_dataset_created()
| ^^^^^^^^^^^^^^^^^^ AIR301
45 | on_dataset_changed()
| |
= help: Use `on_asset_created` from `airflow.listeners.spec.asset` instead. = help: Use `on_asset_created` from `airflow.listeners.spec.asset` instead.
Safe fix Safe fix
40 40 | on_dataset_changed, 36 36 | on_dataset_changed,
41 41 | on_dataset_created, 37 37 | on_dataset_created,
42 42 | ) 38 38 | )
43 |+from airflow.listeners.spec.asset import on_asset_created 39 |+from airflow.listeners.spec.asset import on_asset_created
39 40 |
40 |-on_dataset_created()
41 |+on_asset_created()
41 42 | on_dataset_changed()
42 43 |
43 44 | 43 44 |
44 |-on_dataset_created()
45 |+on_asset_created()
45 46 | on_dataset_changed()
AIR301_names_fix.py:45:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_changed` is removed in Airflow 3.0 AIR301_names_fix.py:41:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_changed` is removed in Airflow 3.0
| |
44 | on_dataset_created() 40 | on_dataset_created()
45 | on_dataset_changed() 41 | on_dataset_changed()
| ^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^ AIR301
| |
= help: Use `on_asset_changed` from `airflow.listeners.spec.asset` instead. = help: Use `on_asset_changed` from `airflow.listeners.spec.asset` instead.
Safe fix Safe fix
40 40 | on_dataset_changed, 36 36 | on_dataset_changed,
41 41 | on_dataset_created, 37 37 | on_dataset_created,
42 42 | ) 38 38 | )
43 |+from airflow.listeners.spec.asset import on_asset_changed 39 |+from airflow.listeners.spec.asset import on_asset_changed
39 40 |
40 41 | on_dataset_created()
41 |-on_dataset_changed()
42 |+on_asset_changed()
42 43 |
43 44 | 43 44 |
44 45 | on_dataset_created() 44 45 | # airflow.operators.python
45 |-on_dataset_changed()
46 |+on_asset_changed() AIR301_names_fix.py:47:1: AIR301 [*] `airflow.operators.python.get_current_context` is removed in Airflow 3.0
|
45 | from airflow.operators.python import get_current_context
46 |
47 | get_current_context()
| ^^^^^^^^^^^^^^^^^^^ AIR301
48 |
49 | # airflow.providers.mysql
|
= help: Use `get_current_context` from `airflow.sdk` instead.
Unsafe fix
42 42 |
43 43 |
44 44 | # airflow.operators.python
45 |-from airflow.operators.python import get_current_context
45 |+from airflow.sdk import get_current_context
46 46 |
47 47 | get_current_context()
48 48 |
AIR301_names_fix.py:52:1: AIR301 [*] `airflow.providers.mysql.datasets.mysql.sanitize_uri` is removed in Airflow 3.0
|
50 | from airflow.providers.mysql.datasets.mysql import sanitize_uri
51 |
52 | sanitize_uri
| ^^^^^^^^^^^^ AIR301
53 |
54 | # airflow.providers.postgres
|
= help: Use `sanitize_uri` from `airflow.providers.mysql.assets.mysql` instead.
Unsafe fix
47 47 | get_current_context()
48 48 |
49 49 | # airflow.providers.mysql
50 |-from airflow.providers.mysql.datasets.mysql import sanitize_uri
50 |+from airflow.providers.mysql.assets.mysql import sanitize_uri
51 51 |
52 52 | sanitize_uri
53 53 |
AIR301_names_fix.py:57:1: AIR301 [*] `airflow.providers.postgres.datasets.postgres.sanitize_uri` is removed in Airflow 3.0
|
55 | from airflow.providers.postgres.datasets.postgres import sanitize_uri
56 |
57 | sanitize_uri
| ^^^^^^^^^^^^ AIR301
58 |
59 | # airflow.providers.trino
|
= help: Use `sanitize_uri` from `airflow.providers.postgres.assets.postgres` instead.
Unsafe fix
52 52 | sanitize_uri
53 53 |
54 54 | # airflow.providers.postgres
55 |-from airflow.providers.postgres.datasets.postgres import sanitize_uri
55 |+from airflow.providers.postgres.assets.postgres import sanitize_uri
56 56 |
57 57 | sanitize_uri
58 58 |
AIR301_names_fix.py:62:1: AIR301 [*] `airflow.providers.trino.datasets.trino.sanitize_uri` is removed in Airflow 3.0
|
60 | from airflow.providers.trino.datasets.trino import sanitize_uri
61 |
62 | sanitize_uri
| ^^^^^^^^^^^^ AIR301
63 |
64 | # airflow.notifications.basenotifier
|
= help: Use `sanitize_uri` from `airflow.providers.trino.assets.trino` instead.
Unsafe fix
57 57 | sanitize_uri
58 58 |
59 59 | # airflow.providers.trino
60 |-from airflow.providers.trino.datasets.trino import sanitize_uri
60 |+from airflow.providers.trino.assets.trino import sanitize_uri
61 61 |
62 62 | sanitize_uri
63 63 |
AIR301_names_fix.py:67:1: AIR301 [*] `airflow.notifications.basenotifier.BaseNotifier` is removed in Airflow 3.0
|
65 | from airflow.notifications.basenotifier import BaseNotifier
66 |
67 | BaseNotifier()
| ^^^^^^^^^^^^ AIR301
68 |
69 | # airflow.auth.manager
|
= help: Use `BaseNotifier` from `airflow.sdk.bases.notifier` instead.
Unsafe fix
62 62 | sanitize_uri
63 63 |
64 64 | # airflow.notifications.basenotifier
65 |-from airflow.notifications.basenotifier import BaseNotifier
65 |+from airflow.sdk.bases.notifier import BaseNotifier
66 66 |
67 67 | BaseNotifier()
68 68 |
AIR301_names_fix.py:72:1: AIR301 [*] `airflow.auth.managers.base_auth_manager.BaseAuthManager` is removed in Airflow 3.0
|
70 | from airflow.auth.managers.base_auth_manager import BaseAuthManager
71 |
72 | BaseAuthManager()
| ^^^^^^^^^^^^^^^ AIR301
|
= help: Use `BaseAuthManager` from `airflow.api_fastapi.auth.managers.base_auth_manager` instead.
Unsafe fix
67 67 | BaseNotifier()
68 68 |
69 69 | # airflow.auth.manager
70 |-from airflow.auth.managers.base_auth_manager import BaseAuthManager
70 |+from airflow.api_fastapi.auth.managers.base_auth_manager import BaseAuthManager
71 71 |
72 72 | BaseAuthManager()
73 73 |
AIR301_names_fix.py:87:1: AIR301 [*] `airflow.configuration.get` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.get` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+conf, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:87:6: AIR301 [*] `airflow.configuration.getboolean` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.getboolean` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+get, conf, getfloat, getint, has_option, remove_option, as_dict, set
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:87:18: AIR301 [*] `airflow.configuration.getfloat` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.getfloat` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+get, getboolean, conf, getint, has_option, remove_option, as_dict, set
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:87:28: AIR301 [*] `airflow.configuration.getint` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.getint` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+get, getboolean, getfloat, conf, has_option, remove_option, as_dict, set
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:87:36: AIR301 [*] `airflow.configuration.has_option` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.has_option` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+get, getboolean, getfloat, getint, conf, remove_option, as_dict, set
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:87:48: AIR301 [*] `airflow.configuration.remove_option` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^^^^^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.remove_option` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+get, getboolean, getfloat, getint, has_option, conf, as_dict, set
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:87:63: AIR301 [*] `airflow.configuration.as_dict` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^^^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.as_dict` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+get, getboolean, getfloat, getint, has_option, remove_option, conf, set
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:87:72: AIR301 [*] `airflow.configuration.set` is removed in Airflow 3.0
|
86 | # airflow.configuration
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
| ^^^ AIR301
88 | from airflow.hooks.base_hook import BaseHook
|
= help: Use `conf.set` from `airflow.configuration` instead.
Safe fix
81 81 | has_option,
82 82 | remove_option,
83 83 | set,
84 |+conf,
84 85 | )
85 86 |
86 87 | # airflow.configuration
87 |-get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |+get, getboolean, getfloat, getint, has_option, remove_option, as_dict, conf
88 89 | from airflow.hooks.base_hook import BaseHook
89 90 |
90 91 | # airflow.hooks
AIR301_names_fix.py:91:1: AIR301 [*] `airflow.hooks.base_hook.BaseHook` is removed in Airflow 3.0
|
90 | # airflow.hooks
91 | BaseHook()
| ^^^^^^^^ AIR301
92 |
93 | from airflow.sensors.base_sensor_operator import BaseSensorOperator
|
= help: Use `BaseHook` from `airflow.hooks.base` instead.
Unsafe fix
85 85 |
86 86 | # airflow.configuration
87 87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |-from airflow.hooks.base_hook import BaseHook
88 |+from airflow.hooks.base import BaseHook
89 89 |
90 90 | # airflow.hooks
91 91 | BaseHook()
AIR301_names_fix.py:96:1: AIR301 [*] `airflow.sensors.base_sensor_operator.BaseSensorOperator` is removed in Airflow 3.0
|
95 | # airflow.sensors.base_sensor_operator
96 | BaseSensorOperator()
| ^^^^^^^^^^^^^^^^^^ AIR301
97 | BaseHook()
|
= help: Use `BaseSensorOperator` from `airflow.sdk.bases.sensor` instead.
Unsafe fix
90 90 | # airflow.hooks
91 91 | BaseHook()
92 92 |
93 |-from airflow.sensors.base_sensor_operator import BaseSensorOperator
93 |+from airflow.sdk.bases.sensor import BaseSensorOperator
94 94 |
95 95 | # airflow.sensors.base_sensor_operator
96 96 | BaseSensorOperator()
AIR301_names_fix.py:97:1: AIR301 [*] `airflow.hooks.base_hook.BaseHook` is removed in Airflow 3.0
|
95 | # airflow.sensors.base_sensor_operator
96 | BaseSensorOperator()
97 | BaseHook()
| ^^^^^^^^ AIR301
98 |
99 | from airflow.utils.helpers import chain as helper_chain
|
= help: Use `BaseHook` from `airflow.hooks.base` instead.
Unsafe fix
85 85 |
86 86 | # airflow.configuration
87 87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
88 |-from airflow.hooks.base_hook import BaseHook
89 88 |
90 89 | # airflow.hooks
91 90 | BaseHook()
92 91 |
93 92 | from airflow.sensors.base_sensor_operator import BaseSensorOperator
93 |+from airflow.hooks.base import BaseHook
94 94 |
95 95 | # airflow.sensors.base_sensor_operator
96 96 | BaseSensorOperator()
AIR301_names_fix.py:103:1: AIR301 [*] `airflow.utils.helpers.chain` is removed in Airflow 3.0
|
102 | # airflow.utils.helpers
103 | helper_chain
| ^^^^^^^^^^^^ AIR301
104 | helper_cross_downstream
|
= help: Use `chain` from `airflow.sdk` instead.
Safe fix
98 98 |
99 99 | from airflow.utils.helpers import chain as helper_chain
100 100 | from airflow.utils.helpers import cross_downstream as helper_cross_downstream
101 |+from airflow.sdk import chain
101 102 |
102 103 | # airflow.utils.helpers
103 |-helper_chain
104 |+chain
104 105 | helper_cross_downstream
105 106 |
106 107 | # airflow.utils.file
AIR301_names_fix.py:104:1: AIR301 [*] `airflow.utils.helpers.cross_downstream` is removed in Airflow 3.0
|
102 | # airflow.utils.helpers
103 | helper_chain
104 | helper_cross_downstream
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
105 |
106 | # airflow.utils.file
|
= help: Use `cross_downstream` from `airflow.sdk` instead.
Safe fix
98 98 |
99 99 | from airflow.utils.helpers import chain as helper_chain
100 100 | from airflow.utils.helpers import cross_downstream as helper_cross_downstream
101 |+from airflow.sdk import cross_downstream
101 102 |
102 103 | # airflow.utils.helpers
103 104 | helper_chain
104 |-helper_cross_downstream
105 |+cross_downstream
105 106 |
106 107 | # airflow.utils.file
107 108 | from airflow.utils.file import TemporaryDirectory
AIR301_names_fix.py:109:1: AIR301 [*] `airflow.utils.file.TemporaryDirectory` is removed in Airflow 3.0
|
107 | from airflow.utils.file import TemporaryDirectory
108 |
109 | TemporaryDirectory()
| ^^^^^^^^^^^^^^^^^^ AIR301
110 |
111 | from airflow.utils.log import secrets_masker
|
= help: Use `TemporaryDirectory` from `tempfile` instead.
Unsafe fix
104 104 | helper_cross_downstream
105 105 |
106 106 | # airflow.utils.file
107 |-from airflow.utils.file import TemporaryDirectory
107 |+from tempfile import TemporaryDirectory
108 108 |
109 109 | TemporaryDirectory()
110 110 |
AIR301_names_fix.py:114:1: AIR301 [*] `airflow.utils.log.secrets_masker` is removed in Airflow 3.0
|
113 | # airflow.utils.log
114 | secrets_masker
| ^^^^^^^^^^^^^^ AIR301
|
= help: Use `secrets_masker` from `airflow.sdk.execution_time` instead.
Unsafe fix
108 108 |
109 109 | TemporaryDirectory()
110 110 |
111 |-from airflow.utils.log import secrets_masker
111 |+from airflow.sdk.execution_time import secrets_masker
112 112 |
113 113 | # airflow.utils.log
114 114 | secrets_masker

View File

@ -1,216 +1,243 @@
--- ---
source: crates/ruff_linter/src/rules/airflow/mod.rs source: crates/ruff_linter/src/rules/airflow/mod.rs
--- ---
AIR301_provider_names_fix.py:25:1: AIR301 [*] `airflow.providers.amazon.aws.auth_manager.avp.entities.AvpEntities.DATASET` is removed in Airflow 3.0 AIR301_provider_names_fix.py:11:1: AIR301 [*] `airflow.providers.amazon.aws.auth_manager.avp.entities.AvpEntities.DATASET` is removed in Airflow 3.0
| |
23 | ) 9 | from airflow.security.permissions import RESOURCE_DATASET
24 | 10 |
25 | AvpEntities.DATASET 11 | AvpEntities.DATASET
| ^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^ AIR301
26 | 12 |
27 | s3_create_dataset() 13 | # airflow.providers.openlineage.utils.utils
| |
= help: Use `AvpEntities.ASSET` from `airflow.providers.amazon.aws.auth_manager.avp.entities` instead. = help: Use `AvpEntities.ASSET` from `airflow.providers.amazon.aws.auth_manager.avp.entities` instead.
Safe fix Safe fix
22 22 | translate_airflow_dataset, 8 8 | from airflow.secrets.local_filesystem import load_connections
23 23 | ) 9 9 | from airflow.security.permissions import RESOURCE_DATASET
24 24 | 10 10 |
25 |-AvpEntities.DATASET 11 |-AvpEntities.DATASET
25 |+AvpEntities.ASSET 11 |+AvpEntities
26 26 | 12 12 |
27 27 | s3_create_dataset() 13 13 | # airflow.providers.openlineage.utils.utils
28 28 | s3_convert_dataset_to_openlineage() 14 14 | DatasetInfo()
AIR301_provider_names_fix.py:27:1: AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.create_dataset` is removed in Airflow 3.0 AIR301_provider_names_fix.py:14:1: AIR301 [*] `airflow.providers.openlineage.utils.utils.DatasetInfo` is removed in Airflow 3.0
| |
25 | AvpEntities.DATASET 13 | # airflow.providers.openlineage.utils.utils
26 | 14 | DatasetInfo()
27 | s3_create_dataset()
| ^^^^^^^^^^^^^^^^^ AIR301
28 | s3_convert_dataset_to_openlineage()
|
= help: Use `create_asset` from `airflow.providers.amazon.aws.assets.s3` instead.
Safe fix
21 21 | DatasetInfo,
22 22 | translate_airflow_dataset,
23 23 | )
24 |+from airflow.providers.amazon.aws.assets.s3 import create_asset
24 25 |
25 26 | AvpEntities.DATASET
26 27 |
27 |-s3_create_dataset()
28 |+create_asset()
28 29 | s3_convert_dataset_to_openlineage()
29 30 |
30 31 | io_create_dataset()
AIR301_provider_names_fix.py:28:1: AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
27 | s3_create_dataset()
28 | s3_convert_dataset_to_openlineage()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
29 |
30 | io_create_dataset()
|
= help: Use `convert_asset_to_openlineage` from `airflow.providers.amazon.aws.assets.s3` instead.
Safe fix
21 21 | DatasetInfo,
22 22 | translate_airflow_dataset,
23 23 | )
24 |+from airflow.providers.amazon.aws.assets.s3 import convert_asset_to_openlineage
24 25 |
25 26 | AvpEntities.DATASET
26 27 |
27 28 | s3_create_dataset()
28 |-s3_convert_dataset_to_openlineage()
29 |+convert_asset_to_openlineage()
29 30 |
30 31 | io_create_dataset()
31 32 | io_convert_dataset_to_openlineage()
AIR301_provider_names_fix.py:36:1: AIR301 [*] `airflow.providers.google.datasets.bigquery.create_dataset` is removed in Airflow 3.0
|
35 | # airflow.providers.google.datasets.bigquery
36 | bigquery_create_dataset()
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
37 | # airflow.providers.google.datasets.gcs
38 | gcs_create_dataset()
|
= help: Use `create_asset` from `airflow.providers.google.assets.bigquery` instead.
Safe fix
21 21 | DatasetInfo,
22 22 | translate_airflow_dataset,
23 23 | )
24 |+from airflow.providers.google.assets.bigquery import create_asset
24 25 |
25 26 | AvpEntities.DATASET
26 27 |
--------------------------------------------------------------------------------
33 34 |
34 35 |
35 36 | # airflow.providers.google.datasets.bigquery
36 |-bigquery_create_dataset()
37 |+create_asset()
37 38 | # airflow.providers.google.datasets.gcs
38 39 | gcs_create_dataset()
39 40 | gcs_convert_dataset_to_openlineage()
AIR301_provider_names_fix.py:38:1: AIR301 [*] `airflow.providers.google.datasets.gcs.create_dataset` is removed in Airflow 3.0
|
36 | bigquery_create_dataset()
37 | # airflow.providers.google.datasets.gcs
38 | gcs_create_dataset()
| ^^^^^^^^^^^^^^^^^^ AIR301
39 | gcs_convert_dataset_to_openlineage()
40 | # airflow.providers.openlineage.utils.utils
|
= help: Use `create_asset` from `airflow.providers.google.assets.gcs` instead.
Safe fix
21 21 | DatasetInfo,
22 22 | translate_airflow_dataset,
23 23 | )
24 |+from airflow.providers.google.assets.gcs import create_asset
24 25 |
25 26 | AvpEntities.DATASET
26 27 |
--------------------------------------------------------------------------------
35 36 | # airflow.providers.google.datasets.bigquery
36 37 | bigquery_create_dataset()
37 38 | # airflow.providers.google.datasets.gcs
38 |-gcs_create_dataset()
39 |+create_asset()
39 40 | gcs_convert_dataset_to_openlineage()
40 41 | # airflow.providers.openlineage.utils.utils
41 42 | DatasetInfo()
AIR301_provider_names_fix.py:39:1: AIR301 [*] `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
37 | # airflow.providers.google.datasets.gcs
38 | gcs_create_dataset()
39 | gcs_convert_dataset_to_openlineage()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
40 | # airflow.providers.openlineage.utils.utils
41 | DatasetInfo()
|
= help: Use `convert_asset_to_openlineage` from `airflow.providers.google.assets.gcs` instead.
Safe fix
21 21 | DatasetInfo,
22 22 | translate_airflow_dataset,
23 23 | )
24 |+from airflow.providers.google.assets.gcs import convert_asset_to_openlineage
24 25 |
25 26 | AvpEntities.DATASET
26 27 |
--------------------------------------------------------------------------------
36 37 | bigquery_create_dataset()
37 38 | # airflow.providers.google.datasets.gcs
38 39 | gcs_create_dataset()
39 |-gcs_convert_dataset_to_openlineage()
40 |+convert_asset_to_openlineage()
40 41 | # airflow.providers.openlineage.utils.utils
41 42 | DatasetInfo()
42 43 | translate_airflow_dataset()
AIR301_provider_names_fix.py:41:1: AIR301 [*] `airflow.providers.openlineage.utils.utils.DatasetInfo` is removed in Airflow 3.0
|
39 | gcs_convert_dataset_to_openlineage()
40 | # airflow.providers.openlineage.utils.utils
41 | DatasetInfo()
| ^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^ AIR301
42 | translate_airflow_dataset() 15 | translate_airflow_dataset()
43 | #
| |
= help: Use `AssetInfo` from `airflow.providers.openlineage.utils.utils` instead. = help: Use `AssetInfo` from `airflow.providers.openlineage.utils.utils` instead.
Safe fix Safe fix
20 20 | from airflow.providers.openlineage.utils.utils import ( 4 4 | from airflow.providers.openlineage.utils.utils import (
21 21 | DatasetInfo, 5 5 | DatasetInfo,
22 22 | translate_airflow_dataset, 6 6 | translate_airflow_dataset,
23 |+AssetInfo, 7 |+AssetInfo,
23 24 | ) 7 8 | )
24 25 | 8 9 | from airflow.secrets.local_filesystem import load_connections
25 26 | AvpEntities.DATASET 9 10 | from airflow.security.permissions import RESOURCE_DATASET
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
38 39 | gcs_create_dataset() 11 12 | AvpEntities.DATASET
39 40 | gcs_convert_dataset_to_openlineage() 12 13 |
40 41 | # airflow.providers.openlineage.utils.utils 13 14 | # airflow.providers.openlineage.utils.utils
41 |-DatasetInfo() 14 |-DatasetInfo()
42 |+AssetInfo() 15 |+AssetInfo()
42 43 | translate_airflow_dataset() 15 16 | translate_airflow_dataset()
43 44 | # 16 17 |
44 45 | # airflow.secrets.local_filesystem 17 18 | # airflow.secrets.local_filesystem
AIR301_provider_names_fix.py:42:1: AIR301 [*] `airflow.providers.openlineage.utils.utils.translate_airflow_dataset` is removed in Airflow 3.0 AIR301_provider_names_fix.py:15:1: AIR301 [*] `airflow.providers.openlineage.utils.utils.translate_airflow_dataset` is removed in Airflow 3.0
| |
40 | # airflow.providers.openlineage.utils.utils 13 | # airflow.providers.openlineage.utils.utils
41 | DatasetInfo() 14 | DatasetInfo()
42 | translate_airflow_dataset() 15 | translate_airflow_dataset()
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301 | ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
43 | # 16 |
44 | # airflow.secrets.local_filesystem 17 | # airflow.secrets.local_filesystem
| |
= help: Use `translate_airflow_asset` from `airflow.providers.openlineage.utils.utils` instead. = help: Use `translate_airflow_asset` from `airflow.providers.openlineage.utils.utils` instead.
Safe fix Safe fix
20 20 | from airflow.providers.openlineage.utils.utils import ( 4 4 | from airflow.providers.openlineage.utils.utils import (
21 21 | DatasetInfo, 5 5 | DatasetInfo,
22 22 | translate_airflow_dataset, 6 6 | translate_airflow_dataset,
23 |+translate_airflow_asset, 7 |+translate_airflow_asset,
23 24 | ) 7 8 | )
24 25 | 8 9 | from airflow.secrets.local_filesystem import load_connections
25 26 | AvpEntities.DATASET 9 10 | from airflow.security.permissions import RESOURCE_DATASET
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
39 40 | gcs_convert_dataset_to_openlineage() 12 13 |
40 41 | # airflow.providers.openlineage.utils.utils 13 14 | # airflow.providers.openlineage.utils.utils
41 42 | DatasetInfo() 14 15 | DatasetInfo()
42 |-translate_airflow_dataset() 15 |-translate_airflow_dataset()
43 |+translate_airflow_asset() 16 |+translate_airflow_asset()
43 44 | # 16 17 |
44 45 | # airflow.secrets.local_filesystem 17 18 | # airflow.secrets.local_filesystem
45 46 | load_connections() 18 19 | load_connections()
AIR301_provider_names_fix.py:18:1: AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
|
17 | # airflow.secrets.local_filesystem
18 | load_connections()
| ^^^^^^^^^^^^^^^^ AIR301
19 |
20 | # airflow.security.permissions
|
= help: Use `load_connections_dict` from `airflow.secrets.local_filesystem` instead.
Safe fix
5 5 | DatasetInfo,
6 6 | translate_airflow_dataset,
7 7 | )
8 |-from airflow.secrets.local_filesystem import load_connections
8 |+from airflow.secrets.local_filesystem import load_connections, load_connections_dict
9 9 | from airflow.security.permissions import RESOURCE_DATASET
10 10 |
11 11 | AvpEntities.DATASET
--------------------------------------------------------------------------------
15 15 | translate_airflow_dataset()
16 16 |
17 17 | # airflow.secrets.local_filesystem
18 |-load_connections()
18 |+load_connections_dict()
19 19 |
20 20 | # airflow.security.permissions
21 21 | RESOURCE_DATASET
AIR301_provider_names_fix.py:21:1: AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0
|
20 | # airflow.security.permissions
21 | RESOURCE_DATASET
| ^^^^^^^^^^^^^^^^ AIR301
22 |
23 | from airflow.providers.amazon.aws.datasets.s3 import (
|
= help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead.
Safe fix
6 6 | translate_airflow_dataset,
7 7 | )
8 8 | from airflow.secrets.local_filesystem import load_connections
9 |-from airflow.security.permissions import RESOURCE_DATASET
9 |+from airflow.security.permissions import RESOURCE_DATASET, RESOURCE_ASSET
10 10 |
11 11 | AvpEntities.DATASET
12 12 |
--------------------------------------------------------------------------------
18 18 | load_connections()
19 19 |
20 20 | # airflow.security.permissions
21 |-RESOURCE_DATASET
21 |+RESOURCE_ASSET
22 22 |
23 23 | from airflow.providers.amazon.aws.datasets.s3 import (
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
AIR301_provider_names_fix.py:28:1: AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.create_dataset` is removed in Airflow 3.0
|
26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
27 |
28 | s3_create_dataset()
| ^^^^^^^^^^^^^^^^^ AIR301
29 | s3_convert_dataset_to_openlineage()
|
= help: Use `create_asset` from `airflow.providers.amazon.aws.assets.s3` instead.
Safe fix
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
25 25 | )
26 26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
27 |+from airflow.providers.amazon.aws.assets.s3 import create_asset
27 28 |
28 |-s3_create_dataset()
29 |+create_asset()
29 30 | s3_convert_dataset_to_openlineage()
30 31 |
31 32 | from airflow.providers.common.io.dataset.file import (
AIR301_provider_names_fix.py:29:1: AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
28 | s3_create_dataset()
29 | s3_convert_dataset_to_openlineage()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
30 |
31 | from airflow.providers.common.io.dataset.file import (
|
= help: Use `convert_asset_to_openlineage` from `airflow.providers.amazon.aws.assets.s3` instead.
Safe fix
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
25 25 | )
26 26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
27 |+from airflow.providers.amazon.aws.assets.s3 import convert_asset_to_openlineage
27 28 |
28 29 | s3_create_dataset()
29 |-s3_convert_dataset_to_openlineage()
30 |+convert_asset_to_openlineage()
30 31 |
31 32 | from airflow.providers.common.io.dataset.file import (
32 33 | convert_dataset_to_openlineage as io_convert_dataset_to_openlineage,
AIR301_provider_names_fix.py:45:1: AIR301 [*] `airflow.providers.google.datasets.bigquery.create_dataset` is removed in Airflow 3.0
|
43 | )
44 |
45 | bigquery_create_dataset()
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
46 |
47 | # airflow.providers.google.datasets.gcs
|
= help: Use `create_asset` from `airflow.providers.google.assets.bigquery` instead.
Safe fix
41 41 | from airflow.providers.google.datasets.bigquery import (
42 42 | create_dataset as bigquery_create_dataset,
43 43 | )
44 |+from airflow.providers.google.assets.bigquery import create_asset
44 45 |
45 |-bigquery_create_dataset()
46 |+create_asset()
46 47 |
47 48 | # airflow.providers.google.datasets.gcs
48 49 | from airflow.providers.google.datasets.gcs import (
AIR301_provider_names_fix.py:53:1: AIR301 [*] `airflow.providers.google.datasets.gcs.create_dataset` is removed in Airflow 3.0
|
51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
52 |
53 | gcs_create_dataset()
| ^^^^^^^^^^^^^^^^^^ AIR301
54 | gcs_convert_dataset_to_openlineage()
|
= help: Use `create_asset` from `airflow.providers.google.assets.gcs` instead.
Safe fix
49 49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
50 50 | )
51 51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
52 |+from airflow.providers.google.assets.gcs import create_asset
52 53 |
53 |-gcs_create_dataset()
54 |+create_asset()
54 55 | gcs_convert_dataset_to_openlineage()
AIR301_provider_names_fix.py:54:1: AIR301 [*] `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
53 | gcs_create_dataset()
54 | gcs_convert_dataset_to_openlineage()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
= help: Use `convert_asset_to_openlineage` from `airflow.providers.google.assets.gcs` instead.
Safe fix
49 49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
50 50 | )
51 51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
52 |+from airflow.providers.google.assets.gcs import convert_asset_to_openlineage
52 53 |
53 54 | gcs_create_dataset()
54 |-gcs_convert_dataset_to_openlineage()
55 |+convert_asset_to_openlineage()