Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D8C3E200C86 for ; Wed, 31 May 2017 10:30:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D5EEE160BCB; Wed, 31 May 2017 08:30:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 28DDC160BBA for ; Wed, 31 May 2017 10:30:12 +0200 (CEST) Received: (qmail 75474 invoked by uid 500); 31 May 2017 08:30:11 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 75465 invoked by uid 99); 31 May 2017 08:30:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 May 2017 08:30:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DD6AB180647 for ; Wed, 31 May 2017 08:30:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id PF_YkhlmpQHR for ; Wed, 31 May 2017 08:30:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 6FB885FBB8 for ; Wed, 31 May 2017 08:30:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DC873E05F7 for ; Wed, 31 May 2017 08:30:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 919D221B55 for ; Wed, 31 May 2017 08:30:04 +0000 (UTC) Date: Wed, 31 May 2017 08:30:04 +0000 (UTC) From: "Sergio Herrera (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AIRFLOW-1252) Experimental API - exception when conf is present in JSON body MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 31 May 2017 08:30:13 -0000 [ 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)