task = ti.task
    for map_index in range(1, 5):
        ti = TI(task, run_id=dr.run_id, map_index=map_index)
        ti.dag_run = dr
        session.add(ti)
    session.flush()
    tis = dr.get_task_instances()
    for ti in tis:
        if ti.task_id == "do_something":
            if ti.map_index > 2:
                ti.state = TaskInstanceState.REMOVED
            else:
                ti.state = TaskInstanceState.SUCCESS
            session.merge(ti)
    session.commit()
    
    (tis, _) = dr.update_state()
    assert len(tis)
    assert dr.state != DagRunState.FAILED
@pytest.mark.parametrize(
    "partial_params, mapped_params, expected",
    [
        pytest.param(None, [{"a": 1}], [[("a", 1)]], id="simple"),
        pytest.param({"b": 2}, [{"a": 1}], [[("a", 1), ("b", 2)]], id="merge"),
        pytest.param({"b": 2}, [{"a": 1, "b": 3}], [[("a", 1), ("b", 3)]], id="override"),
    ],
)
def test_mapped_expand_against_params(dag_maker, partial_params, mapped_params, expected):
    results = []
    class PullOperator(BaseOperator):