dr.dag = serialized_dag
    
    ti = dr.get_task_instance(task_id="task_1")
    task1 = dag.get_task("task_1")
    ti.refresh_from_task(task1)
    ti.run()
    task2 = dag.get_task("task_2")
    for ti in dr.get_task_instances():
        if ti.map_index < 0:
            ti.task = task1
        else:
            ti.task = task2
        session.merge(ti)
    session.flush()
    with caplog.at_level(logging.DEBUG):
        
        dr.verify_integrity()
        tis = dr.get_task_instances()
        indices = [(ti.map_index, ti.state) for ti in tis if ti.map_index >= 0]
        assert sorted(indices) == [
            (0, TaskInstanceState.REMOVED),
            (1, TaskInstanceState.REMOVED),
            (2, TaskInstanceState.REMOVED),
        ]
        assert (
            f"Removing task '{ti1}' as the map_index is longer than the resolved mapping list (0)"
            in caplog.text
        )
@pytest.mark.need_serialized_dag
def test_mapped_mixed_literal_not_expanded_at_create(dag_maker, session):