def validate_id(_id: str):
    """Validates that an _id is ok

    Args:
        _id: to be validated

    Returns:
        _id, if it is acceptable
    """
    if not isinstance(_id, str):
        raise InvalidDocumentIdError(
            "Document _id must be a string type! "
            f"Received _id {_id} of type `{type(_id).__name__}`")
    if not _id:
        raise InvalidDocumentIdError("Document ID can't be empty")
    return _id
Validates that an _id is ok

    Args:
        _id: to be validated

    Returns:
        _id, if it is acceptable
    
src/marqo/tensor_search/validation.py