Reputation: 424
is there any way to pass JSON config from manual DAG run (the one from dag_run.conf['attribute']
to KubernetesPodOperator?
Tried to use the Jinja template on the templated field in YAML, but got an error, dag_run is not defined
.
task_parse_raw_data = KubernetesPodOperator(
namespace=NAMESPACE,
image='artifactory/image:tag',
service_account_name='airflow',
cmds=["sh", "/current.sh"],
arguments=[ {{ dag_run.conf['date']}} ],
...)
Upvotes: 1
Views: 385
Reputation: 3589
You need to wrap the Jinja expression in quotes like so:
arguments=[ "{{ dag_run.conf['date'] }}" ]
Upvotes: 2