Tao Feng created AIRFLOW-2172:
---------------------------------

             Summary: Cast template_fields into a list if the operator's 
template_fields has only one element
                 Key: AIRFLOW-2172
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2172
             Project: Apache Airflow
          Issue Type: Bug
            Reporter: Tao Feng
            Assignee: Tao Feng


Normally user defined operator is derived from BaseOperator. And a jinjafied 
tuple is created for template_fields. If only one field is provided in the 
operator's template_fields as following for example:

template_fields = ('hql')

the resolve_template_files method in BaseOperator actually will throw an 
exception, as the template_fields is now considered as a string instead of a 
list/tuple. In the example, 'h', 'q', 'l' will all consider template field 
attribute.

The workaround is to cast template_frields into a list when its actual type is 
a string. Not sure it is a real bug, but it takes me some time to figure out 
this issue...



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

Reply via email to