Skip to content

Commit 117f1ae

Browse files
committed
test: reorg test cases
1 parent 9c13b12 commit 117f1ae

File tree

4 files changed

+1623
-1722
lines changed

4 files changed

+1623
-1722
lines changed

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,6 @@
4545
from airflow.listeners.spec.dataset import on_dataset_changed, on_dataset_created
4646
from airflow.metrics.validators import AllowListValidator, BlockListValidator
4747
from airflow.models.baseoperator import chain, chain_linear, cross_downstream
48-
49-
50-
51-
52-
53-
54-
55-
56-
57-
5848
from airflow.operators.subdag import SubDagOperator
5949
from airflow.providers.amazon.aws.auth_manager.avp.entities import AvpEntities
6050
from airflow.providers.amazon.aws.datasets import s3
@@ -71,22 +61,6 @@
7161
from airflow.secrets.local_filesystem import LocalFilesystemBackend, load_connections
7262
from airflow.security.permissions import RESOURCE_DATASET
7363
from airflow.sensors.base_sensor_operator import BaseSensorOperator
74-
75-
76-
77-
78-
79-
80-
81-
82-
83-
84-
85-
86-
87-
88-
89-
from airflow.sensors.time_delta_sensor import TimeDeltaSensor
9064
from airflow.timetables.datasets import DatasetOrTimeSchedule
9165
from airflow.timetables.simple import DatasetTriggeredTimetable
9266
from airflow.triggers.external_task import TaskStateTrigger
@@ -230,21 +204,6 @@
230204
BaseSensorOperator()
231205

232206

233-
234-
235-
236-
237-
238-
239-
240-
241-
242-
243-
244-
245-
246-
247-
248207
# airflow.timetables
249208
DatasetOrTimeSchedule()
250209
DatasetTriggeredTimetable()

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

Lines changed: 46 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
from airflow.kubernetes.volume import Volume
101101
from airflow.kubernetes.volume_mount import VolumeMount
102102
from airflow.macros.hive import closest_ds_partition, max_partition
103+
from airflow.operators import (
104+
dagrun_operator,
105+
dummy_operator,
106+
email_operator,
107+
python_operator,
108+
)
103109
from airflow.operators.bash import BashOperator
104110
from airflow.operators.bash_operator import BashOperator as LegacyBashOperator
105111
from airflow.operators.check_operator import (
@@ -115,6 +121,9 @@
115121
from airflow.operators.datetime import BranchDateTimeOperator
116122
from airflow.operators.docker_operator import DockerOperator
117123
from airflow.operators.druid_check_operator import DruidCheckOperator
124+
from airflow.operators.dummy import DummyOperator, EmptyOperator
125+
from airflow.operators.email import EmailOperator
126+
from airflow.operators.email_operator import EmailOperator
118127
from airflow.operators.gcs_to_s3 import GCSToS3Operator
119128
from airflow.operators.google_api_to_s3_transfer import (
120129
GoogleApiToS3Operator,
@@ -153,6 +162,12 @@
153162
PrestoToMySqlOperator,
154163
PrestoToMySqlTransfer,
155164
)
165+
from airflow.operators.python import (
166+
BranchPythonOperator,
167+
PythonOperator,
168+
PythonVirtualenvOperator,
169+
ShortCircuitOperator,
170+
)
156171
from airflow.operators.redshift_to_s3_operator import (
157172
RedshiftToS3Operator,
158173
RedshiftToS3Transfer,
@@ -189,8 +204,14 @@
189204
from airflow.operators.sqlite_operator import SqliteOperator
190205
from airflow.operators.trigger_dagrun import TriggerDagRunOperator
191206
from airflow.operators.weekday import BranchDayOfWeekOperator
207+
from airflow.sensors import external_task_sensor
192208
from airflow.sensors.date_time import DateTimeSensor
193-
from airflow.sensors.external_task import ExternalTaskMarker, ExternalTaskSensor
209+
from airflow.sensors.date_time_sensor import DateTimeSensor
210+
from airflow.sensors.external_task import (
211+
ExternalTaskMarker,
212+
ExternalTaskSensor,
213+
ExternalTaskSensorLink,
214+
)
194215
from airflow.sensors.filesystem import FileSensor
195216
from airflow.sensors.hive_partition_sensor import HivePartitionSensor
196217
from airflow.sensors.http_sensor import HttpSensor
@@ -408,87 +429,43 @@
408429
# apache-airflow-providers-zendesk
409430
ZendeskHook()
410431

432+
# apache-airflow-providers-smtp
433+
EmailOperator()
434+
email_operator.EmailOperator()
435+
411436
# apache-airflow-providers-standard
412-
FileSensor()
413-
TriggerDagRunOperator()
414-
ExternalTaskMarker(), ExternalTaskSensor()
415437
BranchDateTimeOperator()
416438
BranchDayOfWeekOperator()
439+
BranchPythonOperator()
417440
DateTimeSensor()
418-
TimeSensor()
419-
TimeDeltaSensor()
441+
DateTimeTrigger()
420442
DayOfWeekSensor()
443+
DummyOperator()
444+
EmptyOperator()
445+
ExternalTaskMarker()
446+
ExternalTaskSensor()
447+
ExternalTaskSensorLink()
448+
FileSensor()
449+
FileTrigger()
421450
FSHook()
422451
PackageIndexHook()
423452
SubprocessHook()
453+
ShortCircuitOperator()
454+
TimeDeltaSensor()
455+
TimeSensor()
456+
TriggerDagRunOperator()
424457
WorkflowTrigger()
425-
FileTrigger()
426-
DateTimeTrigger()
427-
428-
from airflow.operators import dummy_operator
429-
from airflow.operators.dummy import DummyOperator, EmptyOperator
430-
431-
DummyOperator()
432-
EmptyOperator()
433-
dummy_operator.DummyOperator()
434-
dummy_operator.EmptyOperator()
435-
436-
from airflow.operators import email_operator
437-
from airflow.operators.email import EmailOperator
438-
439-
EmailOperator()
440-
email_operator.EmailOperator()
441-
442-
from airflow.operators import dagrun_operator, dummy_operator, python_operator
443-
from airflow.operators.dummy import DummyOperator, EmptyOperator
444-
from airflow.operators.email_operator import EmailOperator
445-
from airflow.operators.python import (
446-
BranchPythonOperator,
447-
PythonOperator,
448-
PythonVirtualenvOperator,
449-
ShortCircuitOperator,
450-
)
451-
from airflow.sensors.date_time_sensor import DateTimeSensor
452-
from airflow.sensors.external_task import (
453-
ExternalTaskMarker,
454-
ExternalTaskSensor,
455-
ExternalTaskSensorLink,
456-
)
457-
from airflow.sensors.external_task_sensor import (
458-
ExternalTaskMarker as ExternalTaskMarkerFromExternalTaskSensor,
459-
)
460-
from airflow.sensors.external_task_sensor import (
461-
ExternalTaskSensor as ExternalTaskSensorFromExternalTaskSensor,
462-
)
463-
from airflow.sensors.external_task_sensor import (
464-
ExternalTaskSensorLink as ExternalTaskSensorLinkFromExternalTaskSensor,
465-
)
458+
PythonOperator()
459+
PythonVirtualenvOperator()
466460

467461
dagrun_operator.TriggerDagRunLink()
468462
dagrun_operator.TriggerDagRunOperator()
469-
470-
# airflow.sensors.date_time_sensor
471-
DateTimeSensor()
472-
473-
# airflow.sensors.external_task
474-
ExternalTaskSensorLink()
475-
ExternalTaskMarker()
476-
ExternalTaskSensor()
477-
478-
# airflow.sensors.external_task_sensor
479-
ExternalTaskMarkerFromExternalTaskSensor()
480-
ExternalTaskSensorFromExternalTaskSensor()
481-
ExternalTaskSensorLinkFromExternalTaskSensor()
482-
483-
# airflow.sensors.time_delta_sensor
484-
TimeDeltaSensor()
485-
486-
# airflow.operators
463+
dummy_operator.DummyOperator()
464+
dummy_operator.EmptyOperator()
465+
external_task_sensor.ExternalTaskSensorLink()
466+
external_task_sensor.ExternalTaskMarker()
467+
external_task_sensor.ExternalTaskSensor()
487468
python_operator.BranchPythonOperator()
488469
python_operator.PythonOperator()
489470
python_operator.PythonVirtualenvOperator()
490471
python_operator.ShortCircuitOperator()
491-
BranchPythonOperator()
492-
PythonOperator()
493-
PythonVirtualenvOperator()
494-
ShortCircuitOperator()

0 commit comments

Comments
 (0)