-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(AIR302): extension "executors", "operators", "sensors", "hooks" …
…have been removed in AirflowPlugin
- Loading branch information
Showing
5 changed files
with
120 additions
and
2 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
crates/ruff_linter/resources/test/fixtures/airflow/AIR302_airflow_plugin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from airflow.plugins_manager import AirflowPlugin | ||
|
||
|
||
class AirflowTestPlugin(AirflowPlugin): | ||
name = "test_plugin" | ||
# --- Invalid extensions start | ||
operators = [PluginOperator] | ||
sensors = [PluginSensorOperator] | ||
hooks = [PluginHook] | ||
executors = [PluginExecutor] | ||
# --- Invalid extensions end | ||
macros = [plugin_macro] | ||
flask_blueprints = [bp] | ||
appbuilder_views = [v_appbuilder_package] | ||
appbuilder_menu_items = [appbuilder_mitem, appbuilder_mitem_toplevel] | ||
global_operator_extra_links = [ | ||
AirflowLink(), | ||
GithubLink(), | ||
] | ||
operator_extra_links = [ | ||
GoogleLink(), | ||
AirflowLink2(), | ||
CustomOpLink(), | ||
CustomBaseIndexOpLink(1), | ||
] | ||
timetables = [CustomCronDataIntervalTimetable] | ||
listeners = [empty_listener, ClassBasedListener()] | ||
ti_deps = [CustomTestTriggerRule()] | ||
priority_weight_strategies = [CustomPriorityWeightStrategy] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...irflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_airflow_plugin.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/airflow/mod.rs | ||
snapshot_kind: text | ||
--- | ||
AIR302_airflow_plugin.py:7:5: AIR302 `operators` is removed in Airflow 3.0; This extension should just be imported as a regular python module. | ||
| | ||
5 | name = "test_plugin" | ||
6 | # --- Invalid extensions start | ||
7 | operators = [PluginOperator] | ||
| ^^^^^^^^^ AIR302 | ||
8 | sensors = [PluginSensorOperator] | ||
9 | hooks = [PluginHook] | ||
| | ||
|
||
AIR302_airflow_plugin.py:8:5: AIR302 `sensors` is removed in Airflow 3.0; This extension should just be imported as a regular python module. | ||
| | ||
6 | # --- Invalid extensions start | ||
7 | operators = [PluginOperator] | ||
8 | sensors = [PluginSensorOperator] | ||
| ^^^^^^^ AIR302 | ||
9 | hooks = [PluginHook] | ||
10 | executors = [PluginExecutor] | ||
| | ||
|
||
AIR302_airflow_plugin.py:9:5: AIR302 `hooks` is removed in Airflow 3.0; This extension should just be imported as a regular python module. | ||
| | ||
7 | operators = [PluginOperator] | ||
8 | sensors = [PluginSensorOperator] | ||
9 | hooks = [PluginHook] | ||
| ^^^^^ AIR302 | ||
10 | executors = [PluginExecutor] | ||
11 | # --- Invalid extensions end | ||
| | ||
|
||
AIR302_airflow_plugin.py:10:5: AIR302 `executors` is removed in Airflow 3.0; This extension should just be imported as a regular python module. | ||
| | ||
8 | sensors = [PluginSensorOperator] | ||
9 | hooks = [PluginHook] | ||
10 | executors = [PluginExecutor] | ||
| ^^^^^^^^^ AIR302 | ||
11 | # --- Invalid extensions end | ||
12 | macros = [plugin_macro] | ||
| |