Last active
May 22, 2023 14:23
-
-
Save cra/861f9e755f6fce4d612ed4b87ca57601 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from airflow import DAG # noqa | |
from airflow.decorators import dag | |
from airflow.operators.bash import BashOperator | |
from datetime import datetime | |
@dag(start_date=datetime(2023, 5, 1), schedule=None, catchup=False, tags=['yoba']) | |
def read_var_dag(): | |
taska_easy = BashOperator( | |
task_id='bash_task_simple', | |
bash_command='echo "using var in command {{ var.value.my_var }} as a full string"', | |
) | |
taska_easyan = BashOperator( | |
task_id='bash_task_json', | |
bash_command='echo "using var in command {{ var.json.my_var.my_key }} as a deserialized obj"', | |
) | |
taska_easy >> taska_easyan | |
_ = read_var_dag() | |
if __name__ == '__main__': | |
_.test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment