Skip to content

Commit a5ffbbd

Browse files
Standard provider bash operator (#42252)
1 parent bf46f68 commit a5ffbbd

137 files changed

Lines changed: 203 additions & 176 deletions

File tree

Some content is hidden

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

.github/workflows/basic-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ jobs:
200200
breeze release-management prepare-provider-packages fab --package-format wheel --skip-tag-check
201201
- name: "Install Airflow with fab for webserver tests"
202202
run: pip install . dist/apache_airflow_providers_fab-*.whl
203+
- name: "Prepare Standard provider packages: wheel"
204+
run: >
205+
breeze release-management prepare-provider-packages standard --package-format wheel --skip-tag-check
206+
- name: "Install Airflow with standard provider for webserver tests"
207+
run: pip install . dist/apache_airflow_providers_standard-*.whl
203208
- name: "Install Python client"
204209
run: pip install ./dist/apache_airflow_client-*.whl
205210
- name: "Initialize Airflow DB and start webserver"

.pre-commit-config.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -550,17 +550,9 @@ repos:
550550
- id: check-no-providers-in-core-examples
551551
language: pygrep
552552
name: No providers imports in core example DAGs
553-
description: The core example DAGs have no dependencies other than core Airflow
554-
entry: "^\\s*from airflow\\.providers.*"
553+
description: The core example DAGs have no dependencies other than standard provider or core Airflow
554+
entry: "^\\s*from airflow\\.providers.(?!standard.)"
555555
pass_filenames: true
556-
exclude: >
557-
(?x)
558-
^airflow/example_dags/example_branch_datetime_operator.py|
559-
^airflow/example_dags/example_branch_day_of_week_operator.py|
560-
^airflow/example_dags/example_sensors.py|
561-
^airflow/example_dags/example_sensors.py|
562-
^airflow/example_dags/example_sensors.py|
563-
^airflow/example_dags/example_time_delta_sensor_async.py
564556
files: ^airflow/example_dags/.*\.py$
565557
- id: check-no-airflow-deprecation-in-providers
566558
language: pygrep
@@ -717,7 +709,7 @@ repos:
717709
files: >
718710
(?x)
719711
^airflow/providers/.*\.py$
720-
exclude: ^.*/.*_vendor/
712+
exclude: ^.*/.*_vendor/|airflow/providers/standard/operators/bash.py
721713
- id: check-get-lineage-collector-providers
722714
language: python
723715
name: Check providers import hook lineage code from compat

airflow/decorators/bash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from typing import Any, Callable, Collection, Mapping, Sequence
2222

2323
from airflow.decorators.base import DecoratedOperator, TaskDecorator, task_decorator_factory
24-
from airflow.operators.bash import BashOperator
24+
from airflow.providers.standard.operators.bash import BashOperator
2525
from airflow.utils.context import Context, context_merge
2626
from airflow.utils.operator_helpers import determine_kwargs
2727
from airflow.utils.types import NOTSET

airflow/example_dags/example_assets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
from airflow.assets import Asset
5858
from airflow.models.dag import DAG
59-
from airflow.operators.bash import BashOperator
59+
from airflow.providers.standard.operators.bash import BashOperator
6060
from airflow.timetables.assets import AssetOrTimeSchedule
6161
from airflow.timetables.trigger import CronTriggerTimetable
6262

airflow/example_dags/example_bash_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import pendulum
2525

2626
from airflow.models.dag import DAG
27-
from airflow.operators.bash import BashOperator
2827
from airflow.operators.empty import EmptyOperator
28+
from airflow.providers.standard.operators.bash import BashOperator
2929

3030
with DAG(
3131
dag_id="example_bash_operator",

airflow/example_dags/example_complex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from airflow.models.baseoperator import chain
2727
from airflow.models.dag import DAG
28-
from airflow.operators.bash import BashOperator
28+
from airflow.providers.standard.operators.bash import BashOperator
2929

3030
with DAG(
3131
dag_id="example_complex",

airflow/example_dags/example_inlet_event_extra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from airflow.assets import Asset
2929
from airflow.decorators import task
3030
from airflow.models.dag import DAG
31-
from airflow.operators.bash import BashOperator
31+
from airflow.providers.standard.operators.bash import BashOperator
3232

3333
asset = Asset("s3://output/1.txt")
3434

airflow/example_dags/example_outlet_event_extra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from airflow.assets.metadata import Metadata
3030
from airflow.decorators import task
3131
from airflow.models.dag import DAG
32-
from airflow.operators.bash import BashOperator
32+
from airflow.providers.standard.operators.bash import BashOperator
3333

3434
ds = Asset("s3://output/1.txt")
3535

airflow/example_dags/example_passing_params_via_test_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
from airflow.decorators import task
2929
from airflow.models.dag import DAG
30-
from airflow.operators.bash import BashOperator
30+
from airflow.providers.standard.operators.bash import BashOperator
3131

3232

3333
@task(task_id="run_this")

airflow/example_dags/example_sensors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
import pendulum
2323

2424
from airflow.models.dag import DAG
25-
from airflow.operators.bash import BashOperator
25+
from airflow.providers.standard.operators.bash import BashOperator
26+
from airflow.providers.standard.sensors.bash import BashSensor
2627
from airflow.providers.standard.sensors.time import TimeSensor, TimeSensorAsync
2728
from airflow.providers.standard.sensors.time_delta import TimeDeltaSensor, TimeDeltaSensorAsync
2829
from airflow.providers.standard.sensors.weekday import DayOfWeekSensor
29-
from airflow.sensors.bash import BashSensor
3030
from airflow.sensors.filesystem import FileSensor
3131
from airflow.sensors.python import PythonSensor
3232
from airflow.utils.trigger_rule import TriggerRule

0 commit comments

Comments
 (0)