superwise_api.entities.dataset_source

class DatasetSourceApi(superwise_api.entities.base.BaseApi):

This class provides methods to interact with the DatasetSource API.

Attributes:
  • api_client (ApiClient): An instance of the ApiClient to make requests.
  • _model_name (str): The name of the model.
  • _resource_path (str): The path of the resource.
def get_by_id( self, dataset_source_id: str, **kwargs) -> superwise_api.models.dataset_source.dataset_source.DatasetSource:

Retrieves a connection between Dataset and Source by its id.

Arguments:
  • dataset_source_id (str): The id of the connection between Dataset and Source to retrieve.
  • **kwargs: Arbitrary keyword arguments.
Returns:

DatasetSource: The retrieved dataset.

def delete(self, dataset_source_id: str, **kwargs):

Deletes a dataset.

Arguments:
  • dataset_source_id (str): The id of the connection between dataset and a source to delete.
  • **kwargs: Arbitrary keyword arguments.
def create( self, dataset_id: str, source_id: str, ingest_type: superwise_api.models.dataset_source.dataset_source.IngestType, folder: str, **kwargs) -> superwise_api.models.dataset_source.dataset_source.DatasetSource:

Creates a new dataset.

Arguments:
  • dataset_id (str): The id of the dataset.
  • source_id (str): The id of the source.
  • ingest_type (IngestType): The ingest type.
  • folder (str): The folder.
  • **kwargs: Arbitrary keyword arguments.
Returns:

DatasetSource: The created dataset.

def get( self, source_id: Optional[str] = None, dataset_id: Optional[str] = None, folder: Optional[str] = None, ingest_type: Optional[superwise_api.models.dataset_source.dataset_source.IngestType] = None, id: Optional[str] = None, page: Optional[Annotated[int, Strict(strict=True), Interval(gt=None, ge=1, lt=None, le=None), None]] = None, size: Optional[Annotated[int, Strict(strict=True), Interval(gt=None, ge=1, lt=None, le=500), None]] = None, **kwargs) -> superwise_api.client.models.page.Page:

Retrieves datasets based on the provided filters.

Arguments:
  • source_id (Optional[str], optional): The id of the source to retrieve by.
  • dataset_id (Optional[str], optional): The id of the dataset to retrieve by.
  • folder (Optional[str], optional): The folder of the dataset to retrieve by.
  • ingest_type (Optional[IngestType], optional): The ingest type of the dataset to retrieve by.
  • id (Optional[str], optional): The id of the dataset to retrieve by.
  • page (Optional[conint(strict=True, ge=1)], optional): The page number to retrieve.
  • size (Optional[conint(strict=True, le=500, ge=1)], optional): The number of datasets to retrieve per page.
  • **kwargs: Arbitrary keyword arguments.
Returns:

Page: A page of datasets.

def update( self, dataset_source_id: str, *, folder: Optional[str] = None, ingest_type: Optional[superwise_api.models.dataset_source.dataset_source.IngestType] = None, **kwargs) -> superwise_api.models.dataset_source.dataset_source.DatasetSource:

Updates a dataset.

Arguments:
  • dataset_source_id (str): The id of the connection between dataset and a source to update.
  • folder (Optional[str], optional): The folder to update.
  • ingest_type (Optional[IngestType], optional): The ingest type to update.
  • **kwargs: Arbitrary keyword arguments.
Returns:

DatasetSource: The updated connection between a dataset and a source.

Inherited Members
superwise_api.entities.base.BaseApi
BaseApi
api_client
wrap_api_calls
raise_exception