)
            dry_run = True
        if recursion_depth:
            warnings.warn(
                "Passing `recursion_depth` to dag.clear() is deprecated.",
                RemovedInAirflow3Warning,
                stacklevel=2,
            )
        if max_recursion_depth:
            warnings.warn(
                "Passing `max_recursion_depth` to dag.clear() is deprecated.",
                RemovedInAirflow3Warning,
                stacklevel=2,
            )
        state = []
        if only_failed:
            state += [State.FAILED, State.UPSTREAM_FAILED]
        if only_running:
            
            state += [State.RUNNING]
        tis = self._get_task_instances(
            task_ids=task_ids,
            start_date=start_date,
            end_date=end_date,
            run_id=None,
            state=state,
            include_subdags=include_subdags,
            include_parentdag=include_parentdag,
            include_dependent_dags=include_subdags,  
            session=session,