Skip to content

Commit 19fdbe4

Browse files
docs: add DAG documentation for example_bash_decorator (#62948)
* add_DAG_documentation_for_example_bash_decorator * run prek
1 parent 45248f5 commit 19fdbe4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

providers/standard/src/airflow/providers/standard/example_dags/example_bash_decorator.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@
2828

2929
@dag(schedule=None, start_date=pendulum.datetime(2023, 1, 1, tz="UTC"), catchup=False)
3030
def example_bash_decorator():
31+
"""
32+
### Bash TaskFlow Decorator Example
33+
This DAG demonstrates the `@task.bash` decorator for running shell commands from TaskFlow tasks.
34+
It includes:
35+
- Basic bash tasks and loops using `override`
36+
- Jinja templating and context variables
37+
- Skip behavior via non-zero exit codes and conditional branching
38+
- Parameterized environment variables and dynamic command construction
39+
40+
For details, see the Bash decorator documentation
41+
[here](https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/bash.html).
42+
"""
43+
3144
@task.bash
3245
def run_me(sleep_seconds: int, task_instance_key_str: str) -> str:
3346
return f"echo {task_instance_key_str} && sleep {sleep_seconds}"

0 commit comments

Comments
 (0)