Skip to content
Discussion options

You must be logged in to vote

In fact, I was preparing an example to explain my use case, but fortunately, I tested it in a new Airflow docker container, and I found the answer to my question.

Here is a Dag which use dag_run.conf:

with DAG(
    dag_id='airflow_run_conf',
    start_date=datetime(2022, 8, 14),
    default_args=default_args,
    schedule_interval=None,
) as dag:
    task = BashOperator(
        task_id='print_dagrun_conf',
        bash_command='echo "{{ dag_run.conf.get("var") }}"'
    )

And here is an example to how I can override the conf value using Airflow CLI:

airflow dags trigger airflow_run_conf -c '{"var": "val"}'

The second example is a Dag which user params instead of dag_run.conf:

with DAG(
    

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@potiuk
Comment options

potiuk Aug 25, 2022
Collaborator

@Foundsheep
Comment options

Answer selected by hussein-awala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants