turbaszek commented on a change in pull request #9824:
URL: https://github.com/apache/airflow/pull/9824#discussion_r454887450
##########
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:
Should we extend the original clause?
```python
if include_parentdag and self.is_subdag and self.parent_dag is not None:
```
The logic will be the same I think and there will be less changes
----------------------------------------------------------------
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]