Skip to content

Commit

Permalink
feat(AIR302-name): "load_connections" and "get_connection" was rename…
Browse files Browse the repository at this point in the history
…d in "airflow.secrets.local_filesystem"
  • Loading branch information
Lee-W committed Dec 6, 2024
1 parent 7e056c7 commit 499d549
Show file tree
Hide file tree
Showing 3 changed files with 181 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
)
from airflow.metrics.validators import AllowListValidator
from airflow.metrics.validators import BlockListValidator
from airflow.secrets.local_filesystem import get_connection, load_connections
from airflow.utils import dates
from airflow.utils.dates import (
date_range,
Expand Down Expand Up @@ -54,6 +55,9 @@
dates.datetime_to_nano

get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set

get_connection, load_connections

TemporaryDirectory
mkdirs

Expand Down
13 changes: 13 additions & 0 deletions crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@ fn removed_name(checker: &mut Checker, expr: &Expr, ranged: impl Ranged) {
"airflow.metrics.validators.PatternBlockListValidator".to_string(),
),
)),
// airflow.secrets
["airflow", "secrets", "local_filesystem", "load_connections"] => Some((
qualname.to_string(),
Replacement::Name(
"airflow.secrets.local_filesystem.load_connections_dict".to_string(),
),
)),
["airflow", "secrets", "local_filesystem", "get_connection"] => Some((
qualname.to_string(),
Replacement::Name(
"airflow.secrets.local_filesystem.load_connections_dict".to_string(),
),
)),
// airflow.utils.dates
["airflow", "utils", "dates", "date_range"] => Some((
qualname.to_string(),
Expand Down
Loading

0 comments on commit 499d549

Please sign in to comment.