airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Soundar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AIRFLOW-2141) Cannot create airflow variables when there is a list of dictionary as a value
Date Thu, 22 Feb 2018 17:05:00 GMT

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

Soundar updated AIRFLOW-2141:
-----------------------------
    Description: 
I'm trying to create Airflow variables using a json file. I am trying to import airflow variables
using UI(webserver) when I upload the json file I get this error "Missing file or syntax error"
and when I try to upload using airflow cli not all the variables gets uploaded properly. The
catch is that I have a list of dictionary in my json file, say
 ex:
 {
 "demo_archivedir": "/home/ubuntu/folders/archive",
 "demo_filepattern": [

{ "id": "reference", "pattern": "Sample Data.xlsx" }

,

{ "id": "sale", "pattern": "Sales.xlsx" }

],
 "demo_sourcepath": "/home/ubuntu/folders/input",
 "demo_workdir": "/home/ubuntu/folders/working"
 }

I've attached two images 

img1. Using airflow variables cli command I was able to create partial variables from my json
file(airflow_cli.png)img2. After inserting logs in the "airflow/bin/cli.py" file, I got this
error. (airflow_cli2_crop.png)

The thing is I gave this value through the Admin UI one by one and it worked. Then I exported
those same variable using "airflow variables" cli command and tried importing them, still
it failed and the above mentioned error still occurs.

Note:
  I am using Python 3.5 with Airflow version 1.8

  was:
I'm trying to create Airflow variables using a json file. I am trying to import airflow variables
using UI(webserver) when I upload the json file I get this error "Missing file or syntax error"
and when I try to upload using airflow cli not all the variables gets uploaded properly. The
catch is that I have a list of dictionary in my json file, say
ex:
{
 "demo_archivedir": "/home/ubuntu/folders/archive",
 "demo_filepattern": [
 {
 "id": "reference",
 "pattern": "Sample Data.xlsx"
 },
 {
 "id": "sale",
 "pattern": "Sales.xlsx"
 }
 ],
 "demo_sourcepath": "/home/ubuntu/folders/input",
 "demo_workdir": "/home/ubuntu/folders/working"
}

 

I've attached two images 
img1. Using airflow variables cli command I was able to create partial variables from my json
file(airflow_cli.png)
img2. After inserting logs in the "airflow/bin/cli.py" file, I got this error. (airflow_cli2_crop.png)


> Cannot create airflow variables when there is a list of dictionary as a value
> -----------------------------------------------------------------------------
>
>                 Key: AIRFLOW-2141
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2141
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: aws
>    Affects Versions: Airflow 1.8
>            Reporter: Soundar
>            Priority: Major
>              Labels: beginner, newbie
>         Attachments: airflow_cli.png, airflow_cli2_crop.png
>
>
> I'm trying to create Airflow variables using a json file. I am trying to import airflow
variables using UI(webserver) when I upload the json file I get this error "Missing file or
syntax error" and when I try to upload using airflow cli not all the variables gets uploaded
properly. The catch is that I have a list of dictionary in my json file, say
>  ex:
>  {
>  "demo_archivedir": "/home/ubuntu/folders/archive",
>  "demo_filepattern": [
> { "id": "reference", "pattern": "Sample Data.xlsx" }
> ,
> { "id": "sale", "pattern": "Sales.xlsx" }
> ],
>  "demo_sourcepath": "/home/ubuntu/folders/input",
>  "demo_workdir": "/home/ubuntu/folders/working"
>  }
> I've attached two images 
> img1. Using airflow variables cli command I was able to create partial variables from
my json file(airflow_cli.png)img2. After inserting logs in the "airflow/bin/cli.py" file,
I got this error. (airflow_cli2_crop.png)
> The thing is I gave this value through the Admin UI one by one and it worked. Then I
exported those same variable using "airflow variables" cli command and tried importing them,
still it failed and the above mentioned error still occurs.
> Note:
>   I am using Python 3.5 with Airflow version 1.8



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

Mime
View raw message