ashb commented on a change in pull request #19965:
URL: https://github.com/apache/airflow/pull/19965#discussion_r771508381



##########
File path: airflow/models/baseoperator.py
##########
@@ -1659,6 +1629,115 @@ def defer(
         """
         raise TaskDeferred(trigger=trigger, method_name=method_name, 
kwargs=kwargs, timeout=timeout)
 
+    def map(self, **kwargs) -> "MappedOperator":
+        return MappedOperator(
+            operator_class=type(self),
+            operator=self,
+            task_id=self.task_id,
+            task_group=getattr(self, 'task_group', None),
+            dag=getattr(self, '_dag', None),
+            start_date=self.start_date,
+            end_date=self.end_date,
+            partial_kwargs=self.__init_kwargs,
+            mapped_kwargs=kwargs,
+        )
+
+
+def _validate_kwarg_names_for_mapping(cls: Type[BaseOperator], func_name: str, 
value: Dict[str, Any]):

Review comment:
       Similar, but the way this gets the possible names (most of the function) 
is quite differnt, so I couldn't work out a way of really sharing it




-- 
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]


Reply via email to