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

Matthew Bowden commented on AIRFLOW-4451:
-----------------------------------------

While PR 4691 did introduce the error, the place where the error occurs is 
actually here: 
[https://github.com/apache/airflow/blob/356ecd2a5680d6f0c0d04e8657785d78b3ce1b82/airflow/models/baseoperator.py#L649-L650]

That line accepts both a list _or_ a tuple, and returns a list for either. For 
both collections.namedtuple and typing.NamedTuple, this breaks any downstream 
functionality.

This can be addressed by performing a specific check for named tuples in the 
render_template function:
{code:java}
isinstance(x, tuple) and type(x) is not tuple{code}
The above returns True for named tuples and False for regular tuples. I will 
try to get a PR out for this in the next few days, hopefully we can get that 
fix in 1.10.4 because we used named tuples heavily [~ash].

> [AIRFLOW-1814] converts namedtuples args in PythonOperators to lists
> --------------------------------------------------------------------
>
>                 Key: AIRFLOW-4451
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4451
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: operators
>    Affects Versions: 1.10.3
>            Reporter: Ross Mechanic
>            Priority: Major
>
> Upgrading to Airflow 1.10.3 from Airflow 1.10.2 removed support for passing 
> in `namedtuple`s as `op_kwargs` or `op_args` to `PythonOperator`. The 
> specific PR that made the breaking change is 
> [https://github.com/apache/airflow/pull/4691]
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to