You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Ash Berlin-Taylor (JIRA)" <ji...@apache.org> on 2019/07/31 09:48:00 UTC

[jira] [Updated] (AIRFLOW-4170) Set variable using json in CLI

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

Ash Berlin-Taylor updated AIRFLOW-4170:
---------------------------------------
    Fix Version/s: 1.10.4

> Set variable using json in CLI
> ------------------------------
>
>                 Key: AIRFLOW-4170
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4170
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: cli
>            Reporter: Chen Tong
>            Priority: Major
>             Fix For: 1.10.4
>
>
> When importing variables, it serializes value in JSON way only when value is dict. But value may be list or other types, which is also valid JSON type.   
> {code:java}
> if isinstance(v, dict):
>     Variable.set(k, v, serialize_json=True)
> else:
>     Variable.set(k, v)
> {code}
> One use case is first export values into a file and then import the file to variables. Since the export is always a JSON file. Import may be invalid when the value type is not dict. 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)