https://github.com/apache/airflow/blob/main/airflow/cli/commands/task_command.py#L145
return self._replace(tis=[t for t in self.tis if t.state in State.unfinished])
        start_dttm = timezone.utcnow()
        self.last_scheduling_decision = start_dttm
        with Stats.timer(
            f"dagrun.dependency-check.{self.dag_id}",
            tags=self.stats_tags,
        ):
            dag = self.get_dag()
            info = self.task_instance_scheduling_decisions(session)
            tis = info.tis
            schedulable_tis = info.schedulable_tis
            changed_tis = info.changed_tis
            finished_tis = info.finished_tis
            unfinished = _UnfinishedStates.calculate(info.unfinished_tis)
            if unfinished.should_schedule:
                are_runnable_tasks = schedulable_tis or changed_tis
                
                if not are_runnable_tasks:
                    are_runnable_tasks, changed_by_upstream = self._are_premature_tis(
                        unfinished.tis, finished_tis, session
                    )
                    if changed_by_upstream:  
                        unfinished = unfinished.recalculate()