uranusjr commented on a change in pull request #21505:
URL: https://github.com/apache/airflow/pull/21505#discussion_r804872002
##########
File path: airflow/decorators/base.py
##########
@@ -337,30 +361,47 @@ def _merge_kwargs(
return {**kwargs1, **kwargs2}
[email protected](kw_only=True)
[email protected](kw_only=True, repr=False)
class DecoratedMappedOperator(MappedOperator):
"""MappedOperator implementation for @task-decorated task function."""
multiple_outputs: bool
python_callable: Callable
- def create_unmapped_operator(self, dag: "DAG") -> BaseOperator:
+ # We can't save these in partial_kwargs because op_args and op_kwargs need
+ # to be present in mapped_kwargs, and MappedOperator prevents duplication.
+ partial_op_kwargs: Dict[str, Any]
+
+ @classmethod
+ @cache
+ def get_serialized_fields(cls):
+ return MappedOperator.get_serialized_fields() | {"partial_op_kwargs"}
Review comment:
Using the “old style” `super` to work around this.
```python
sup = super(DecoratedMappedOperator, DecoratedMappedOperator)
return sup.get_serialized_fields() | {"partial_op_kwargs"}
```
Experience with Python 2 is still useful sometimes 🙂
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]