ds_provider_grasp_py_lib.dataset.cart¶
File: cart.py
Region: ds_provider_grasp_py_lib/dataset/cart
Grasp Cart Dataset
This module implements a dataset for Grasp Cart.
Example
>>> dataset = GraspCartDataset(
... id=uuid.uuid4(),
... name="cart-dataset",
... version="1.0.0",
... deserializer=PandasDeserializer(format=DatasetStorageFormatType.JSON),
... serializer=PandasSerializer(format=DatasetStorageFormatType.JSON),
... settings=GraspCartDatasetSettings(
... owner_id="owner_id",
... product_group_name="product_group_name",
... product_name="product_name",
... version="version",
... include_history=True,
... ),
... linked_service=GraspAwsLinkedService(
... id=uuid.uuid4(),
... name="aws-linked-service",
... version="1.0.0",
... settings=GraspAwsLinkedServiceSettings(
... access_key_id="access_key_id",
... access_key_secret="access_key_secret",
... region="region",
... ),
... ),
... )
>>> dataset.read()
>>> data = dataset.output
Attributes¶
Classes¶
Settings for Grasp Cart dataset operations. |
|
Tabular dataset object which identifies data within a data store, |
Module Contents¶
- ds_provider_grasp_py_lib.dataset.cart.logger¶
- class ds_provider_grasp_py_lib.dataset.cart.GraspCartDatasetSettings[source]¶
Bases:
ds_resource_plugin_py_lib.common.resource.dataset.DatasetSettingsSettings for Grasp Cart dataset operations.
- owner_id: str¶
The owner ID of the cart.
- product_group_name: str¶
The product group name of the cart.
- product_name: str¶
The product name of the cart.
- version: str = '1.0'¶
The version of the cart.
- include_history: bool = False¶
Whether to include history in the cart.
- ds_provider_grasp_py_lib.dataset.cart.GraspCartDatasetSettingsType¶
- ds_provider_grasp_py_lib.dataset.cart.AWSLinkedServiceType¶
- class ds_provider_grasp_py_lib.dataset.cart.GraspCartDataset[source]¶
Bases:
ds_resource_plugin_py_lib.common.resource.dataset.TabularDataset[AWSLinkedServiceType,GraspCartDatasetSettingsType,ds_resource_plugin_py_lib.common.serde.serialize.AwsWranglerSerializer,ds_resource_plugin_py_lib.common.serde.deserialize.AwsWranglerDeserializer],Generic[AWSLinkedServiceType,GraspCartDatasetSettingsType]Tabular dataset object which identifies data within a data store, such as table/csv/json/parquet/parquetdataset/ and other documents.
The input of the dataset is a pandas DataFrame. The output of the dataset is a pandas DataFrame.
- linked_service: AWSLinkedServiceType¶
- settings: GraspCartDatasetSettingsType¶
- property type: ds_provider_grasp_py_lib.enums.ResourceType¶
Get the type of the dataset.
- create() None[source]¶
Insert all rows in
self.inputinto the target as a single atomic transaction. Must not delete, update, or overwrite existing data.- Raises:
CreateError – If the operation fails.
NotSupportedError – If the provider does not support create.
See also
Full contract:
docs/DATASET_CONTRACT.md–create()
- read() None[source]¶
Read data from the Grasp Cart dataset.
- Raises:
ReadError – If the read operation fails, including when no files are found at the S3 path or when the S3 path is invalid.
- delete() NoReturn[source]¶
Remove specific rows from the target matched by identity columns defined in
self.settings. Atomic. Idempotent.- Raises:
DeleteError – If the operation fails.
NotSupportedError – If the provider does not support delete.
See also
Full contract:
docs/DATASET_CONTRACT.md–delete()
- update() NoReturn[source]¶
Update existing rows in the target matched by identity columns defined in
self.settings. Atomic. Must not insert new rows.- Raises:
UpdateError – If the operation fails.
NotSupportedError – If the provider does not support update.
See also
Full contract:
docs/DATASET_CONTRACT.md–update()
- upsert() NoReturn[source]¶
Insert rows that do not exist, update rows that do, matched by identity columns defined in
self.settings. Atomic.- Raises:
UpsertError – If the operation fails.
NotSupportedError – If the provider does not support upsert.
See also
Full contract:
docs/DATASET_CONTRACT.md–upsert()
- rename() NoReturn[source]¶
Rename the resource in the backend. Atomic. Not idempotent.
- Raises:
RenameError – If the operation fails.
NotSupportedError – If the provider does not support renaming.
See also
Full contract:
docs/DATASET_CONTRACT.md–rename()
- purge() NoReturn[source]¶
Remove all content from the target.
self.inputis not used. Atomic. Idempotent.- Raises:
PurgeError – If the operation fails.
NotSupportedError – If the provider does not support purge.
See also
Full contract:
docs/DATASET_CONTRACT.md–purge()
- list() NoReturn[source]¶
Discover available resources and populate
self.outputwith a DataFrame of resources and their metadata. Idempotent.- Raises:
ListError – If the operation fails.
NotSupportedError – If the provider does not support listing.
See also
Full contract:
docs/DATASET_CONTRACT.md–list()