milton0825 commented on a change in pull request #9824:
URL: https://github.com/apache/airflow/pull/9824#discussion_r455220118
##########
File path: airflow/models/dag.py
##########
@@ -1026,26 +1025,26 @@ def clear(
tis = tis.filter(TI.task_id.in_(self.task_ids))
if include_parentdag and self.is_subdag:
-
- p_dag = self.parent_dag.sub_dag(
- task_regex=r"^{}$".format(self.dag_id.split('.')[1]),
- include_upstream=False,
- include_downstream=True)
-
- tis = tis.union(p_dag.clear(
- start_date=start_date, end_date=end_date,
- only_failed=only_failed,
- only_running=only_running,
- confirm_prompt=confirm_prompt,
- include_subdags=include_subdags,
- include_parentdag=False,
- reset_dag_runs=reset_dag_runs,
- get_tis=True,
- session=session,
- recursion_depth=recursion_depth,
- max_recursion_depth=max_recursion_depth,
- dag_bag=dag_bag
- ))
+ if self.parent_dag is not None:
Review comment:
Good point. Updated the code.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]