"""Test that set_task_group_state updates the TaskGroup state and clear downstream failed"""
    start_date = datetime_tz(2020, 1, 1)
    with dag_maker("test_set_task_group_state", start_date=start_date, session=session) as dag:
        start = EmptyOperator(task_id="start")
        with TaskGroup("section_1", tooltip="Tasks for section_1") as section_1:
            task_1 = EmptyOperator(task_id="task_1")
            task_2 = EmptyOperator(task_id="task_2")
            task_3 = EmptyOperator(task_id="task_3")
            task_1 >> [task_2, task_3]
        task_4 = EmptyOperator(task_id="task_4")
        task_5 = EmptyOperator(task_id="task_5")
        task_6 = EmptyOperator(task_id="task_6")
        task_7 = EmptyOperator(task_id="task_7")
        task_8 = EmptyOperator(task_id="task_8")
        start >> section_1 >> [task_4, task_5, task_6, task_7, task_8]
    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):