dag = DAG("my-dag")  
    dag.timetable = timetable
    assert not dag._check_schedule_interval_matches_timetable()
@pytest.mark.parametrize("run_id, execution_date", [(None, datetime_tz(2020, 1, 1)), ("test-run-id", None)])
def test_set_task_instance_state(run_id, execution_date, session, dag_maker):
    """Test that set_task_instance_state updates the TaskInstance state and clear downstream failed"""
    start_date = datetime_tz(2020, 1, 1)
    with dag_maker("test_set_task_instance_state", start_date=start_date, session=session) as dag:
        task_1 = EmptyOperator(task_id="task_1")
        task_2 = EmptyOperator(task_id="task_2")
        task_3 = EmptyOperator(task_id="task_3")
        task_4 = EmptyOperator(task_id="task_4")
        task_5 = EmptyOperator(task_id="task_5")
        task_1 >> [task_2, task_3, task_4, task_5]
    dagrun = dag_maker.create_dagrun(
        run_id=run_id,
        execution_date=execution_date,
        state=State.FAILED,
        run_type=DagRunType.SCHEDULED,
    )
    def get_ti_from_db(task):
        return (
            session.query(TI)
            .filter(
                TI.dag_id == dag.dag_id,
                TI.task_id == task.task_id,
                TI.run_id == dagrun.run_id,
            )
            .one()
        )