airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-1177) variable json deserialize does not work at set defaults
Date Thu, 01 Nov 2018 20:22:00 GMT


ASF GitHub Bot commented on AIRFLOW-1177:

ashb closed pull request #2278: [AIRFLOW-1177] Fixed bug: default json variable cannot be
deserialized due to bad return value.

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/ b/airflow/
index aab4833ae8..3fed579bad 100755
--- a/airflow/
+++ b/airflow/
@@ -3682,9 +3682,9 @@ def setdefault(cls, key, default, deserialize_json=False):
                 raise ValueError('Default Value must be set')
             if deserialize_json:
-                return json.loads(obj.val)
+                return json.loads(obj)
-                return obj.val
+                return obj


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> variable json deserialize does not work at set defaults
> -------------------------------------------------------
>                 Key: AIRFLOW-1177
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: models
>    Affects Versions: 1.8.0
>            Reporter: barak schoster
>            Assignee: barak schoster
>            Priority: Major
>             Fix For: 1.9.0
> at line:
> obj has no attribute val, it is the val itself.
> it will throw error like:
> Variable.setdefault("some_key", deserialize_json=True,default=json.dumps(default_dag_variables))
>   File "/usr/local/lib/python2.7/site-packages/airflow/", line 3586, in setdefault
>     return json.loads(obj.val)
> AttributeError: 'unicode' object has no attribute 'val'

This message was sent by Atlassian JIRA

View raw message