def METHOD_NAME(
    self,
    task_id: str,
    task_run_id: str,
    requester_id: str,
    assignment_id: str,
    unit_index: int,
    pay_amount: float,
    provider_type: str,
    task_type: str,
    sandbox: bool = True,
) -> str:
    """
    Create a new unit with the given index. Raises EntryAlreadyExistsException
    if there is already a unit for the given assignment with the given index.
    """
    if assignment_id in self._assignment_to_unit_mapping:
        del self._assignment_to_unit_mapping[assignment_id]
    return super()._new_unit(
        task_id=task_id,
        task_run_id=task_run_id,
        requester_id=requester_id,
        assignment_id=assignment_id,
        unit_index=unit_index,
        pay_amount=pay_amount,
        provider_type=provider_type,
        task_type=task_type,
        sandbox=sandbox,
    )