Skip to main content

pc.get_dataset

pc.get_dataset(dataset_name=None, connection_name=None, dataset_id=None)

Get and return the specified dataset. Can get a datset either via name and connection
or id but not both. If both dataset_name + connection_name and dataset_id are
specified, an error will be thrown.

Parameters:

   dataset_name: str, default None
Name of dataset to return.

   connection_name: str, default None
Name of connection to get dataset from.

   dataset_id: int, default None
ID of dataset to get.

Returns:

   Dataset

Examples:

Get a Dataset by name and connection.

    dataset = pc.get_dataset(dataset_name='Titanic Dataset', connection_name='Postgres Connection')

Get a Datset by ID.

    pc.list_datasets()
# > [Dataset(id=1234, name=Titanic Dataset, object_name=titanic, connection_id=0, author=jsmith, ...),
# Dataset(id=1235, name=Fraud Dataset, object_name=fraud, connection_id=1, author=jdoe, ...),

dataset = pc.get_dataset(dataset_id=1234)