airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergio Herrera (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body
Date Sat, 21 Apr 2018 15:56:00 GMT

    [ https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16446782#comment-16446782
] 

Sergio Herrera edited comment on AIRFLOW-1252 at 4/21/18 3:55 PM:
------------------------------------------------------------------

I usually use a Python Operator where you can show the JSON that reach the DAG (do not forget
to enable the provide context for this operator).


was (Author: sergiohgz):
I usually use a Python Operator where you can show the JSON that reach the DAG (do not forget
to enable the provide context for this operator). Later I will give you an example of a DAG
to analyze that ;) 

> Experimental API - exception when conf is present in JSON body
> --------------------------------------------------------------
>
>                 Key: AIRFLOW-1252
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1252
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: api
>    Affects Versions: Airflow 1.8, 1.8.1
>            Reporter: Sergio Herrera
>            Assignee: Sergio Herrera
>            Priority: Major
>              Labels: api
>
> When someones calls to the endpoint _POST <host>:<port>/api/experimental/dags/<dag_id>/dag_runs
{}_, Airflow never run that request if the body of that contains _conf_.
> This occurs due to a mismatch between types when calling function _trigger_dag()_, which
is also used by *CLI*. That function perform a _json.loads(conf)_ because from CLI the type
of conf is _string_, but, in the other side, from *experimental API*, that type is _dict_
(because _Json_ is processed before to get all data, such as execution_date).
> There are two possibilities:
> 1. Look for every use of _trigger_dag()_ function and put _Json_ formatting from outside
the function.
> 2. In the *experimental API*, put the conf in a string (with _json.dumps()_) to allow
_trigger_dag()_ transform into _dict_.
> I have implemented the second option, so I can make a PR with that if you want.
> Thank you a lot
> EDIT: Also, there are no tests which uses conf in the Json passed through request currently.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message