def mutate_task_instance(task_instance):
            if task_instance.queue == "queue1":
                task_instance.queue = "queue2"
            else:
                task_instance.queue = "queue1"
        mock_hook.side_effect = mutate_task_instance
        dag = DAG("test_task_instance_mutation_hook", start_date=DEFAULT_DATE)
        dag.add_task(EmptyOperator(task_id="task_to_mutate", owner="test", queue="queue1"))
        dagrun = self.create_dag_run(dag, session=session)
        task = dagrun.get_task_instances()[0]
        task.state = state
        session.merge(task)
        session.commit()
        assert task.queue == "queue2"
        dagrun.verify_integrity()
        task = dagrun.get_task_instances()[0]
        assert task.queue == "queue1"
    @pytest.mark.parametrize(
        "prev_ti_state, is_ti_success",
        [
            (TaskInstanceState.SUCCESS, True),
            (TaskInstanceState.SKIPPED, True),
            (TaskInstanceState.RUNNING, False),
            (TaskInstanceState.FAILED, False),
            (None, False),
        ],
    )
    def test_depends_on_past(self, session, prev_ti_state, is_ti_success):