Skip to content

Commit 30f116f

Browse files
committed
Merge branch 'main' into dcreager/legacy-typevar-instance
* main: [`ruff`] add fix safety section (`RUF017`) (#17480) Add Python 3.14 to configuration options (#17647) [`airflow`] Apply auto fixes to cases where the names have changed in Airflow 3 (`AIR302`) (#17553)
2 parents 8e78adc + 5096824 commit 30f116f

File tree

61 files changed

+3342
-2643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3342
-2643
lines changed

crates/ruff_linter/resources/test/fixtures/airflow/AIR302.py

Lines changed: 0 additions & 481 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from __future__ import annotations
2+
3+
from airflow.hooks.S3_hook import (
4+
S3Hook,
5+
provide_bucket_name,
6+
)
7+
from airflow.operators.gcs_to_s3 import GCSToS3Operator
8+
from airflow.operators.google_api_to_s3_transfer import (
9+
GoogleApiToS3Operator,
10+
GoogleApiToS3Transfer,
11+
)
12+
from airflow.operators.redshift_to_s3_operator import (
13+
RedshiftToS3Operator,
14+
RedshiftToS3Transfer,
15+
)
16+
from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
17+
from airflow.operators.s3_to_redshift_operator import (
18+
S3ToRedshiftOperator,
19+
S3ToRedshiftTransfer,
20+
)
21+
from airflow.sensors.s3_key_sensor import S3KeySensor
22+
23+
S3Hook()
24+
provide_bucket_name()
25+
26+
GCSToS3Operator()
27+
28+
GoogleApiToS3Operator()
29+
GoogleApiToS3Transfer()
30+
31+
RedshiftToS3Operator()
32+
RedshiftToS3Transfer()
33+
34+
S3FileTransformOperator()
35+
36+
S3ToRedshiftOperator()
37+
S3ToRedshiftTransfer()
38+
39+
S3KeySensor()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from __future__ import annotations
2+
3+
from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
4+
from airflow.executors.celery_executor import (
5+
CeleryExecutor,
6+
app,
7+
)
8+
9+
DEFAULT_CELERY_CONFIG
10+
11+
app
12+
CeleryExecutor()
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
from __future__ import annotations
2+
3+
from airflow.hooks.dbapi import (
4+
ConnectorProtocol,
5+
DbApiHook,
6+
)
7+
from airflow.hooks.dbapi_hook import DbApiHook
8+
from airflow.operators.check_operator import SQLCheckOperator
9+
10+
ConnectorProtocol()
11+
DbApiHook()
12+
SQLCheckOperator()
13+
14+
15+
from airflow.operators.check_operator import CheckOperator
16+
from airflow.operators.sql import SQLCheckOperator
17+
18+
SQLCheckOperator()
19+
CheckOperator()
20+
21+
22+
from airflow.operators.druid_check_operator import CheckOperator
23+
24+
CheckOperator()
25+
26+
27+
from airflow.operators.presto_check_operator import CheckOperator
28+
29+
CheckOperator()
30+
31+
32+
from airflow.operators.check_operator import (
33+
IntervalCheckOperator,
34+
SQLIntervalCheckOperator,
35+
)
36+
from airflow.operators.druid_check_operator import DruidCheckOperator
37+
from airflow.operators.presto_check_operator import PrestoCheckOperator
38+
39+
DruidCheckOperator()
40+
PrestoCheckOperator()
41+
IntervalCheckOperator()
42+
SQLIntervalCheckOperator()
43+
44+
45+
from airflow.operators.presto_check_operator import (
46+
IntervalCheckOperator,
47+
PrestoIntervalCheckOperator,
48+
)
49+
from airflow.operators.sql import SQLIntervalCheckOperator
50+
51+
IntervalCheckOperator()
52+
SQLIntervalCheckOperator()
53+
PrestoIntervalCheckOperator()
54+
55+
56+
from airflow.operators.check_operator import (
57+
SQLThresholdCheckOperator,
58+
ThresholdCheckOperator,
59+
)
60+
61+
SQLThresholdCheckOperator()
62+
ThresholdCheckOperator()
63+
64+
65+
from airflow.operators.sql import SQLThresholdCheckOperator
66+
67+
SQLThresholdCheckOperator()
68+
69+
70+
from airflow.operators.check_operator import (
71+
SQLValueCheckOperator,
72+
ValueCheckOperator,
73+
)
74+
75+
SQLValueCheckOperator()
76+
ValueCheckOperator()
77+
78+
79+
from airflow.operators.presto_check_operator import (
80+
PrestoValueCheckOperator,
81+
ValueCheckOperator,
82+
)
83+
from airflow.operators.sql import SQLValueCheckOperator
84+
85+
SQLValueCheckOperator()
86+
ValueCheckOperator()
87+
PrestoValueCheckOperator()
88+
89+
90+
from airflow.operators.sql import (
91+
BaseSQLOperator,
92+
BranchSQLOperator,
93+
SQLColumnCheckOperator,
94+
SQLTablecheckOperator,
95+
_convert_to_float_if_possible,
96+
parse_boolean,
97+
)
98+
99+
BaseSQLOperator()
100+
BranchSQLOperator()
101+
SQLTablecheckOperator()
102+
SQLColumnCheckOperator()
103+
_convert_to_float_if_possible()
104+
parse_boolean()
105+
106+
107+
from airflow.sensors.sql import SqlSensor
108+
109+
SqlSensor()
110+
111+
112+
from airflow.sensors.sql_sensor import SqlSensor
113+
114+
SqlSensor()
115+
116+
117+
from airflow.operators.jdbc_operator import JdbcOperator
118+
from airflow.operators.mssql_operator import MsSqlOperator
119+
from airflow.operators.mysql_operator import MySqlOperator
120+
from airflow.operators.oracle_operator import OracleOperator
121+
from airflow.operators.postgres_operator import PostgresOperator
122+
from airflow.operators.sqlite_operator import SqliteOperator
123+
124+
JdbcOperator()
125+
MsSqlOperator()
126+
MySqlOperator()
127+
OracleOperator()
128+
PostgresOperator()
129+
SqliteOperator()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from __future__ import annotations
2+
3+
from airflow.executors.dask_executor import DaskExecutor
4+
5+
DaskExecutor()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import annotations
2+
3+
from airflow.hooks.docker_hook import DockerHook
4+
from airflow.operators.docker_operator import DockerOperator
5+
6+
DockerHook()
7+
DockerOperator()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from __future__ import annotations
2+
3+
from airflow.hooks.druid_hook import (
4+
DruidDbApiHook,
5+
DruidHook,
6+
)
7+
from airflow.operators.hive_to_druid import (
8+
HiveToDruidOperator,
9+
HiveToDruidTransfer,
10+
)
11+
12+
DruidDbApiHook()
13+
DruidHook()
14+
15+
HiveToDruidOperator()
16+
HiveToDruidTransfer()
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
from __future__ import annotations
2+
3+
from airflow.api.auth.backend.basic_auth import (
4+
CLIENT_AUTH,
5+
auth_current_user,
6+
init_app,
7+
requires_authentication,
8+
)
9+
10+
CLIENT_AUTH
11+
init_app()
12+
auth_current_user()
13+
requires_authentication()
14+
15+
from airflow.api.auth.backend.kerberos_auth import (
16+
CLIENT_AUTH,
17+
find_user,
18+
init_app,
19+
log,
20+
requires_authentication,
21+
)
22+
23+
log()
24+
CLIENT_AUTH
25+
find_user()
26+
init_app()
27+
requires_authentication()
28+
29+
from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
30+
CLIENT_AUTH,
31+
find_user,
32+
init_app,
33+
log,
34+
requires_authentication,
35+
)
36+
37+
log()
38+
CLIENT_AUTH
39+
find_user()
40+
init_app()
41+
requires_authentication()
42+
43+
from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
44+
from airflow.auth.managers.fab.security_manager.override import (
45+
MAX_NUM_DATABASE_USER_SESSIONS,
46+
FabAirflowSecurityManagerOverride,
47+
)
48+
49+
FabAuthManager()
50+
MAX_NUM_DATABASE_USER_SESSIONS
51+
FabAirflowSecurityManagerOverride()
52+
53+
from airflow.www.security import FabAirflowSecurityManagerOverride
54+
55+
FabAirflowSecurityManagerOverride()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import annotations
2+
3+
from airflow.hooks.webhdfs_hook import WebHDFSHook
4+
from airflow.sensors.web_hdfs_sensor import WebHdfsSensor
5+
6+
WebHDFSHook()
7+
WebHdfsSensor()
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
from __future__ import annotations
2+
3+
from airflow.hooks.hive_hooks import (
4+
HIVE_QUEUE_PRIORITIES,
5+
HiveCliHook,
6+
HiveMetastoreHook,
7+
HiveServer2Hook,
8+
)
9+
from airflow.macros.hive import (
10+
closest_ds_partition,
11+
max_partition,
12+
)
13+
from airflow.operators.hive_operator import HiveOperator
14+
from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15+
from airflow.operators.hive_to_mysql import (
16+
HiveToMySqlOperator,
17+
HiveToMySqlTransfer,
18+
)
19+
from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
20+
from airflow.operators.mssql_to_hive import (
21+
MsSqlToHiveOperator,
22+
MsSqlToHiveTransfer,
23+
)
24+
from airflow.operators.mysql_to_hive import (
25+
MySqlToHiveOperator,
26+
MySqlToHiveTransfer,
27+
)
28+
from airflow.operators.s3_to_hive_operator import (
29+
S3ToHiveOperator,
30+
S3ToHiveTransfer,
31+
)
32+
from airflow.sensors.hive_partition_sensor import HivePartitionSensor
33+
from airflow.sensors.metastore_partition_sensor import MetastorePartitionSensor
34+
from airflow.sensors.named_hive_partition_sensor import NamedHivePartitionSensor
35+
36+
closest_ds_partition()
37+
max_partition()
38+
39+
HiveCliHook()
40+
HiveMetastoreHook()
41+
HiveServer2Hook()
42+
HIVE_QUEUE_PRIORITIES
43+
44+
HiveOperator()
45+
46+
HiveStatsCollectionOperator()
47+
48+
HiveToMySqlOperator()
49+
HiveToMySqlTransfer()
50+
51+
HiveToSambaOperator()
52+
53+
MsSqlToHiveOperator()
54+
MsSqlToHiveTransfer()
55+
56+
MySqlToHiveOperator()
57+
MySqlToHiveTransfer()
58+
59+
S3ToHiveOperator()
60+
S3ToHiveTransfer()
61+
62+
HivePartitionSensor()
63+
64+
MetastorePartitionSensor()
65+
66+
NamedHivePartitionSensor()

0 commit comments

Comments
 (0)