airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Wang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-1791) Unexpected "AttributeError: 'unicode' object has no attribute 'val'" from Variable.setdefault
Date Wed, 08 Nov 2017 07:12:00 GMT
Shawn Wang created AIRFLOW-1791:
-----------------------------------

             Summary: Unexpected "AttributeError: 'unicode' object has no attribute 'val'"
from Variable.setdefault
                 Key: AIRFLOW-1791
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1791
             Project: Apache Airflow
          Issue Type: Bug
          Components: core
    Affects Versions: Airflow 1.8
         Environment: Python 2.7, Airflow 1.8.2
            Reporter: Shawn Wang


In Variable.setdefault method,

{code:python}
        obj = Variable.get(key, default_var=default_sentinel, deserialize_json=False)
        if obj is default_sentinel:
            // ...
        else:
            if deserialize_json:
                return json.loads(obj.val)
            else:
                return obj.val
{code}

While obj is retrieved by "get" method which has already fetched the val attribute from obj,
so this "obj.val" throws the AttributeError.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message