airflow_api_plugin icon indicating copy to clipboard operation
airflow_api_plugin copied to clipboard

Can't pass conf to dag

Open Dutisto opened this issue 7 years ago • 3 comments

Hi, I'm using your plugin and I got a hard time passing conf to my dag. My dag runs without problems in CLI airflow trigger_dag test --conf '{"workingDir":"/tmp/aZEf"}' . However, using your plugin, I can't pass my parameter "workingDir", I end up having None instead of /tmp/aZEf. I'm using the last version of your plugin and Airflow v1.9.0 with CeleryExecutor. My post request looks like this : curl -X POST \ http://xxx.xxx.xxx.xxx:xxxx/api/v1/dag_runs \ -H 'authorization: secret \ -H 'cache-control: no-cache' \ -H 'content-type: application/json' \ -d '{"dag_id":"test","conf":{"workingDir":"/tmp/aZEf"}}'

Any help would be appreciated =]

Dutisto avatar Aug 29 '18 09:08 Dutisto

Thanks for your issue @Dutisto. Assigning to @cwurtz.

benjamingregory avatar Aug 29 '18 16:08 benjamingregory

When you saying you end up having None instead of /tmp/aZEf, where are you seeing that? In the API call? When the DAG runs?

What response does the curl command give you?

cwurtz avatar Aug 29 '18 19:08 cwurtz

I get None in my DAG when running, it's the value of {{ dag_run.conf }}. I just write it to a file to check the value and I get None. However using the trigger_dag, I get what I want. The curl response is a success and as expected. I just feel like the conf is not passed to the dag

Dutisto avatar Sep 04 '18 14:09 Dutisto