You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/02 13:44:28 UTC
[GitHub] [airflow] uranusjr commented on a change in pull request #21210: Make `airflow dags test` be able to execute Mapped Tasks
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org