Example #1
0
def delete_all(session: Session, dataset: AnyDataset):
    """Delete all records in this dataset

    Args:
        dataset: Dataset from which to delete records
    """
    r = session.delete(str(dataset.url) + "/records")
    response.successful(r)
Example #2
0
def delete(session: Session, attribute: Attribute):
    """Deletes an existing attribute

    Sends a deletion request to the Tamr server

    Args:
        attribute: Existing attribute to delete

    Raises:
        attribute.NotFound: If no attribute could be found at the specified URL.
            Corresponds to a 404 HTTP error.
        requests.HTTPError: If any other HTTP error is encountered.
    """
    r = session.delete(str(attribute.url))
    if r.status_code == 404:
        raise NotFound(str(attribute.url))
    response.successful(r)
Example #3
0
def delete(session: Session, dataset: Dataset, *, cascade: bool = False):
    """Deletes an existing dataset

    Sends a deletion request to the Tamr server

    Args:
        dataset: Existing dataset to delete
        cascade: Whether to delete all derived datasets as well

    Raises:
        dataset.NotFound: If no dataset could be found at the specified URL.
            Corresponds to a 404 HTTP error.
        requests.HTTPError: If any other HTTP error is encountered.
    """
    r = session.delete(str(dataset.url), params={"cascade": cascade})
    if r.status_code == 404:
        raise NotFound(str(dataset.url))
    response.successful(r)