[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2018-11-18 Thread Ash Berlin-Taylor (JIRA)


 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ash Berlin-Taylor updated AIRFLOW-1252:
---
Fix Version/s: 1.10.2

> 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: 1.8.0, 1.8.1, 1.9.0, 1.10.0, 2.0.0
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>Priority: Major
>  Labels: api
> Fix For: 2.0.0, 1.10.2
>
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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.
> Examples:
>  - Before fix (escaped json):
> {noformat}
> POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1
> Content-Type: application/json
> {
>   "conf": "{
> \"k1\": \"v1\",
> \"k2\": \"v2\",
> \"k3\": [\"av1\", \"av2\", \"av3\"],
> \"k4\": {
>   \"sk1\": \"sv1\",
>   \"sk2\": \"sv2\"
> }
>   }"  
> }
> {noformat}
>  - After fix (pure json):
> {noformat}
> POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1
> Content-Type: application/json
> {
>   "conf": {
> "k1": "v1",
> "k2": "v2",
> "k3": ["av1", "av2", "av3"],
> "k4": {
>   "sk1": "sv1",
>   "sk2": "sv2"
> }
>   }
> }
> {noformat}
>  



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


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2018-06-27 Thread Sergio Herrera (JIRA)


 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Description: 
When someones calls to the endpoint _POST 
:/api/experimental/dags//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.

Examples:
 - Before fix (escaped json):
{noformat}
POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1
Content-Type: application/json
{
  "conf": "{
\"k1\": \"v1\",
\"k2\": \"v2\",
\"k3\": [\"av1\", \"av2\", \"av3\"],
\"k4\": {
  \"sk1\": \"sv1\",
  \"sk2\": \"sv2\"
}
  }"  
}
{noformat}

 - After fix (pure json):
{noformat}
POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1
Content-Type: application/json
{
  "conf": {
"k1": "v1",
"k2": "v2",
"k3": ["av1", "av2", "av3"],
"k4": {
  "sk1": "sv1",
  "sk2": "sv2"
}
  }
}
{noformat}
 

  was:
When someones calls to the endpoint _POST 
:/api/experimental/dags//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.

Examples:
 - Before fix:
{{POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1}}
{{Content-Type: application/json}}
{{{}}
{{  "conf": {}}
{{    \"k1\": \"v1\",}}
{{    \"k2\": \"v2\",}}{{  }}
{{    \"k3\": {{[\"av1\", \"av2\", \"av3\"]}},}}{{  }}
{{    \"k4\": }}{{{ }}
{{      \"sk1\": \"sv1\",}}
{{       \"sk2\": \"sv2\" }}
{{    }}}
{{  }}}
{{ }}}

 - After fix:
{{POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1}}
{{Content-Type: application/json}}{{ }}
{{{}}{{ }}
{{  "conf": {}}
{{    "k1": "v1",}}
{{    "k2": "v2",}}{{  }}
{{    "k3": {{["av1", "av2", "av3"]}},}}{{  }}
{{    "k4": }}{{{ }}
{{      "sk1": "sv1", }}
{{      "sk2": "sv2" }}
{{    }}}
{{  }}}
{{}}}

 


> 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, 1.9.0, 1.10.0, 2.0.0
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>Priority: Major
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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.
> Examples:
>  - Before fix (e

[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2018-06-27 Thread Sergio Herrera (JIRA)


 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Flags: Important
Affects Version/s: 2.0.0
   1.10.0
   1.9.0
  Description: 
When someones calls to the endpoint _POST 
:/api/experimental/dags//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.

Examples:
 - Before fix:
{{POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1}}
{{Content-Type: application/json}}
{{{}}
{{  "conf": {}}
{{    \"k1\": \"v1\",}}
{{    \"k2\": \"v2\",}}{{  }}
{{    \"k3\": {{[\"av1\", \"av2\", \"av3\"]}},}}{{  }}
{{    \"k4\": }}{{{ }}
{{      \"sk1\": \"sv1\",}}
{{       \"sk2\": \"sv2\" }}
{{    }}}
{{  }}}
{{ }}}

 - After fix:
{{POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1}}
{{Content-Type: application/json}}{{ }}
{{{}}{{ }}
{{  "conf": {}}
{{    "k1": "v1",}}
{{    "k2": "v2",}}{{  }}
{{    "k3": {{["av1", "av2", "av3"]}},}}{{  }}
{{    "k4": }}{{{ }}
{{      "sk1": "sv1", }}
{{      "sk2": "sv2" }}
{{    }}}
{{  }}}
{{}}}

 

  was:
When someones calls to the endpoint _POST 
:/api/experimental/dags//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.


> 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, 1.9.0, 1.10.0, 2.0.0
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>Priority: Major
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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.
> Examples:
>  - Before fix:
> {{POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1}}
> {{Content-Type: application/json}}
> {{{}}
> {{  "conf": {}}
> {{    \"k1\": \"v1\",}}
> {{    \"k2\": \"v2\",}}{{  }}
> {{    \"k3\": {{[\"av1\", \"av2\", \"av3\"]}},}}{{  }}
> {{    \"k4\": }}{{{ }}
> {{      \"sk1\": \"sv1\",}}
> {{       \"sk2\": \"sv2\" }}
> {{    }}}
> {{  }}}
> {{ }}}
>  - After fix:
> {{POST /api/experimental/dags/test_conf/dag_runs HTTP/1.1}}
> {{Content-Type: application/json}}{{ }}
> 

[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-06-01 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Affects Version/s: (was: 1.8.2)
   (was: 1.9.0)
   (was: Airflow 2.0)

> 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
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-31 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Environment: (was: Python 2.7)

> 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 2.0, Airflow 1.8, 1.8.1, 1.9.0, 1.8.2
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-31 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Affects Version/s: Airflow 2.0

> 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 2.0, Airflow 1.8, 1.8.1, 1.9.0, 1.8.2
> Environment: Python 2.7
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-31 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Affects Version/s: 1.8.2
   1.9.0

> 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, 1.9.0, 1.8.2
> Environment: Python 2.7
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-31 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Description: 
When someones calls to the endpoint _POST 
:/api/experimental/dags//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.

  was:
When someones calls to the endpoint _POST 
:/api/experimental/dags//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


> 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
> Environment: Python 2.7
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-30 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Labels: api  (was: )

> 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
> Environment: Python 2.7
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>  Labels: api
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-29 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Description: 
When someones calls to the endpoint _POST 
:/api/experimental/dags//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

  was:
When someones calls to the endpoint 
_POST :/api/experimental/dags//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


> 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
> Environment: Python 2.7
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>
> When someones calls to the endpoint _POST 
> :/api/experimental/dags//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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-29 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Description: 
When someones calls to the endpoint 
_POST :/api/experimental/dags//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

  was:
When someones calls to the endpoint ``, Airflow never run that request.
This occurs due to a mismatch between types when calling function 
trigger_dag(), which is also used by CLI client. 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).

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() the transform into dict.

I have implemented the second option, so I can make a PR with that if you want.

Thank you a lot


> 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
> Environment: Python 2.7
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>
> When someones calls to the endpoint 
> _POST :/api/experimental/dags//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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body

2017-05-29 Thread Sergio Herrera (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Herrera updated AIRFLOW-1252:

Summary: Experimental API - exception when conf is present in JSON body  
(was: Experimental API - exception when conf is presetn in JSON body)

> 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
> Environment: Python 2.7
>Reporter: Sergio Herrera
>Assignee: Sergio Herrera
>
> When someones calls to the endpoint ``, Airflow never run that request.
> This occurs due to a mismatch between types when calling function 
> trigger_dag(), which is also used by CLI client. 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).
> 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() the transform into dict.
> I have implemented the second option, so I can make a PR with that if you 
> want.
> Thank you a lot



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)