Chen Tong created AIRFLOW-4170:
----------------------------------
Summary: 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
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.3#76005)