uranusjr commented on a change in pull request #21210:
URL: https://github.com/apache/airflow/pull/21210#discussion_r797619596



##########
File path: airflow/executors/debug_executor.py
##########
@@ -76,6 +79,8 @@ def _run_task(self, ti: TaskInstance) -> bool:
         key = ti.key
         try:
             params = self.tasks_params.pop(ti.key, {})
+            if ti.task.is_mapped:
+                ti.task = cast("MappedOperator", ti.task).unmap()

Review comment:
       My OO training tells me polymorphism is better than an if clause, so my 
vote goes to `return self`. But ultimately I guess either makes sense 
(depending on how your mental model is of the logic).

##########
File path: airflow/executors/debug_executor.py
##########
@@ -76,6 +79,8 @@ def _run_task(self, ti: TaskInstance) -> bool:
         key = ti.key
         try:
             params = self.tasks_params.pop(ti.key, {})
+            if ti.task.is_mapped:
+                ti.task = cast("MappedOperator", ti.task).unmap()

Review comment:
       My OOP training tells me polymorphism is better than an if clause, so my 
vote goes to `return self`. But ultimately I guess either makes sense 
(depending on how your mental model is of the logic).




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