rhino_health.lib.endpoints.dataset.dataset_endpoints#
Module Contents#
Classes#
@base_class False |
- class rhino_health.lib.endpoints.dataset.dataset_endpoints.DatasetEndpoints(session)#
Bases:
rhino_health.lib.endpoints.endpoint.Endpoint@base_class False
Endpoints available to interact with Datasets on the Rhino Platform
Notes
You should access these endpoints from the RhinoSession object
- property dataset_dataclass#
- get_dataset(dataset_uid: str)#
Returns a Dataset dataclass
- Parameters:
- dataset_uid: str
UID for the Dataset
- Returns:
- dataset: Dataset
Dataset dataclass
Examples
>>> session.dataset.get_dataset(my_dataset_uid) Dataset()
- get_dataset_metric(dataset_uid: str, metric_configuration) rhino_health.lib.metrics.base_metric.MetricResponse#
Queries the Dataset with DATASET_UID on-prem and returns the result based on the METRIC_CONFIGURATION
- Parameters:
- dataset_uid: str
UID for the Dataset to query metrics against
- metric_configuration:
Configuration for the query to run
- Returns:
- metric_response: MetricResponse
A response object containing the result of the query
See also
rhino_health.lib.metricsDataclasses specifying possible metric configurations to send
rhino_health.lib.metrics.base_metric.MetricResponseResponse object
- get_dataset_by_name(name, version=VersionMode.LATEST, project_uid=None) rhino_health.lib.endpoints.dataset.dataset_dataclass.Dataset | None#
Returns the latest or a specific Dataset dataclass
Warning
VersionMode.ALL will return the same as VersionMode.LATEST
- Parameters:
- name: str
Full name for the Dataset
- version: Optional[Union[int, VersionMode]]
Version of the Dataset, latest by default, for an earlier version pass in an integer
- project_uid: Optional[str]
Project UID to search under
- Returns:
- dataset: Optional[Dataset]
Dataset with the name or None if not found
Examples
>>> session.dataset.get_dataset_by_name("My Dataset") Dataset(name="My Dataset")
- search_for_datasets_by_name(name: str, version: int | rhino_health.lib.endpoints.endpoint.VersionMode | None = VersionMode.LATEST, project_uid: str | None = None, name_filter_mode: rhino_health.lib.endpoints.endpoint.NameFilterMode | None = NameFilterMode.CONTAINS)#
Returns Dataset dataclasses
- Parameters:
- name: str
Full or partial name for the Dataset
- version: Optional[Union[int, VersionMode]]
Version of the Dataset, latest by default
- project_uid: Optional[str]
Project UID to search under
- name_filter_mode: Optional[NameFilterMode]
Only return results with the specified filter mode, By default uses CONTAINS
- Returns:
- datasets: List[Dataset]
Dataset dataclasses that match the name
See also
rhino_health.lib.endpoints.endpoint.FilterModeDifferent modes to filter by
rhino_health.lib.endpoints.endpoint.VersionModeWhich version to return
Examples
>>> session.dataset.search_for_datasets_by_name("My Dataset") [Dataset(name="My Dataset")]
- add_dataset(dataset: rhino_health.lib.endpoints.dataset.dataset_dataclass.DatasetCreateInput, return_existing=True, add_version_if_exists=False) rhino_health.lib.endpoints.dataset.dataset_dataclass.Dataset#
Adds a new Dataset on the remote instance.
- Parameters:
- dataset: DatasetCreateInput
DatasetCreateInput data class
- return_existing: bool
If a Dataset with the name already exists, return it instead of creating one. Takes precedence over add_version_if_exists
- add_version_if_exists
If a Dataset with the name already exists, create a new version.
- Returns:
- dataset: Dataset
Dataset dataclass
Examples
>>> session.dataset.add_dataset(add_dataset_input) Dataset()
- export_dataset(dataset_uid: str, output_location: str, output_format: str)#
Sends an export dataset request to the ON-PREM instance holding the specified DATASET_UID. The file will be exported to OUTPUT_LOCATION on the on-prem instance in OUTPUT_FORMAT
Warning
This feature is under development and the interface may change
- Parameters:
- dataset_uid: str
UID for the Dataset to export information on
- output_location: str
Path to output the exported data to on the remote on-prem instance
- output_format: str
The format to export the Dataset data in
- sync_dataset_info(dataset_uid: str)#
Initializes a data sync from the relevant on-prem instance for the provided DATASET_UID
Warning
This feature is under development and the interface may change
- Parameters:
- dataset_uid: str
UID for the Dataset to sync info
- remove_dataset(dataset_or_uid: str | rhino_health.lib.endpoints.dataset.dataset_dataclass.Dataset)#
Remove a Dataset with DATASET_OR_UID from the system
- publish(dataset_or_uid, unpublish_other_versions: bool = True)#
Makes the dataset dataclass or uid published and visible to users without the permission to view all versions UNPUBLISH_OTHER_VERSIONS if true
- unpublish(dataset_or_uid)#
Makes this dataset dataclass or uid unpublished so users without the permission to view all versions no longer see this