[ 
https://issues.apache.org/jira/browse/AIRFLOW-2415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488608#comment-16488608
 ] 

ASF subversion and git services commented on AIRFLOW-2415:
----------------------------------------------------------

Commit ce9c7bbdfcbc931029077f5564e60746dba05cfa in incubator-airflow's branch 
refs/heads/master from [~mpayton]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=ce9c7bb ]

[AIRFLOW-2415] Make airflow DAG templating render numbers

Currently, if you have an operator with a template
fields argument, that is a dictionary, e.g.:
template_fields = ([dict_args])

And you populate that dictionary with a field that
an integer in a DAG, e.g.:
...
dict_args = {'ds': '{{ ds }}', num_times: 5}
...

Then ariflow will give you the following error:
{base_task_runner.py:95} INFO - Subtask:
airflow.exceptions.AirflowException: Type '<type
'int'>' used for parameter 'dict_args[num_times]'
is not supported for templating

This fix aims to resolves that issue by
immediately resolving numbers without attempting
to template them

Closes #3410 from
ArgentFalcon/support_numeric_template_fields


> Airflow Operators are unable to support integers in templatized fields
> ----------------------------------------------------------------------
>
>                 Key: AIRFLOW-2415
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2415
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: Airflow 2.0, Airflow 1.8
>            Reporter: Max Payton
>            Priority: Minor
>
> Currently, if you have an operator with a template fields argument that is a 
> dictionary, e.g.:
> {code:java}
> template_fields = ([dict_args])
> {code}
> And you populate that dictionary with a field that an integer in a DAG, e.g.:
> {code:java}
> Operator(
>     ...
>     dict_args = {'ds': '{{ ds }}', num_times: 5},
>     ...
> ){code}
> Then airflow will give you the following error:
> {code:java}
> {base_task_runner.py:95}
> INFO - Subtask: airflow.exceptions.AirflowException: Type '<type 'int'>' used 
> for parameter 'dict_args[num_times]' is not supported for templating
> {code}



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

Reply via email to