ashb commented on a change in pull request #20743:
URL: https://github.com/apache/airflow/pull/20743#discussion_r784799141
##########
File path: airflow/models/baseoperator.py
##########
@@ -1672,20 +1677,52 @@ def _validate_kwarg_names_for_mapping(cls:
Type[BaseOperator], func_name: str, v
class MappedOperator(DAGNode):
"""Object representing a mapped operator in a DAG"""
- operator_class: Type[BaseOperator] = attr.ib(repr=lambda c: c.__name__)
+ @staticmethod
+ def _operator_class_repr(val):
+ # Can be a string if we are de-serialized
+ if isinstance(val, str):
+ return val.rsplit('.', 1)[-1]
+ return val.__name__
+
+ def __repr__(self) -> str:
+ return (
+
'MappedOperator(operator_class={self._operator_class_repr(self.operator_class)},
'
+ + 'task_id={self.task_id!r},
partial_kwargs={self.partial_kwargs!r}, '
+ + 'mapped_kwargs={self.mapped_kwargs!r}, dag={self.dag})'
Review comment:
Whoops!
--
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]