You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Tao Feng (JIRA)" <ji...@apache.org> on 2018/05/29 00:39:00 UTC

[jira] [Closed] (AIRFLOW-2172) Cast template_fields into a list if the operator's template_fields has only one element

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

Tao Feng closed AIRFLOW-2172.
-----------------------------
    Resolution: Won't Fix

> 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
>            Priority: Minor
>
> 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)