ds_provider_aic_py_lib.dataset¶
File: __init__.py
Region: ds_provider_aic_py_lib/dataset
AIC gold dataset.
Example
>>> dataset = AICGoldDataset(
... id=uuid.uuid4(),
... name="employees",
... version="1.0.0",
... linked_service=linked_service,
... settings=AICGoldDatasetSettings(
... publish_mode=PublishMode.UPSERT,
... primary_key_fields=["employee_id"],
... history_mode=HistoryMode.SCD2,
... partition_keys=[],
... read=GoldReadSettings(sql="SELECT * FROM gold"),
... ),
... )
>>> dataset.read()
>>> dataset.output
Submodules¶
Classes¶
Read-only gold dataset. Mutation methods are not supported. |
|
Published gold definition and the fetch scope for this dataset. |
|
Scope for |
|
SQL sent to fetch for |
Package Contents¶
- class ds_provider_aic_py_lib.dataset.AICGoldDataset[source]¶
Bases:
ds_resource_plugin_py_lib.common.resource.dataset.TabularDataset[AICIdentityLinkedServiceType,AICGoldDatasetSettingsType,ds_resource_plugin_py_lib.common.serde.serialize.PandasSerializer,ds_provider_aic_py_lib.serde.deserializer.FetchQueryDeserializer],Generic[AICIdentityLinkedServiceType,AICGoldDatasetSettingsType]Read-only gold dataset. Mutation methods are not supported.
- linked_service: AICIdentityLinkedServiceType¶
- settings: AICGoldDatasetSettingsType¶
- serializer: ds_resource_plugin_py_lib.common.serde.serialize.PandasSerializer | None = None¶
Unused. Gold is read-only.
- deserializer: ds_provider_aic_py_lib.serde.deserializer.FetchQueryDeserializer¶
Materializes one fetch query page.
- property type: ds_provider_aic_py_lib.enums.ResourceType¶
Resource type discriminator.
- property supports_checkpoint: bool¶
A failed read keeps the next offset in
checkpoint['pagination'].
- read() None[source]¶
Post the required SQL and assign this call’s result to
output.Fetch stops a response at 100_000 rows or 8 MiB. This call follows truncated pages until the result is complete. On a resumed read,
outputholds only the pages from the saved offset; the caller keeps earlier pages. Passcheckpoint['pagination']['offset']to continue, or an empty checkpoint to read from the start. Keep the same SQL in settings. The offset is not stored with the statement.Later pages use
OFFSET. Fetch does not keep a stable row order unless the SQL hasORDER BY, so those pages can skip or repeat rows. A read that continues withoutORDER BYlogs a warning and still returns the rows. A failure keeps the pages already read in this call inoutputand the next offset incheckpoint['pagination']. A truncated page with no rows to continue from raises and leaves that offset in place.- Raises:
ReadError – SQL is missing, a quoted reference names another dataset, fetch rejects a page, or a truncated page cannot be continued.
- class ds_provider_aic_py_lib.dataset.AICGoldDatasetSettings[source]¶
Bases:
ds_resource_plugin_py_lib.common.resource.dataset.DatasetSettingsPublished gold definition and the fetch scope for this dataset.
- url: str = 'https://grasp-daas.com/api/fetch/v1'¶
Fetch API base URL.
- publish_mode: ds_provider_aic_py_lib.enums.PublishMode¶
How candidate rows mutate published gold state. Stored, not executed.
- primary_key_fields: AICGoldDatasetSettings.list[str]¶
Business key of the published dataset.
- history_mode: ds_provider_aic_py_lib.enums.HistoryMode¶
History strategy of the published dataset.
- partition_keys: AICGoldDatasetSettings.list[str]¶
Partition columns of the published dataset.
- ordering_field: str | None = None¶
Duplicate-winner field of the published dataset.
- delete_field: str | None = None¶
Delete-intent field of the published dataset.
- read: GoldReadSettings | None = None¶
SQL for
read(). Required when reading.
- list: GoldListSettings¶
Scope for
list().
- class ds_provider_aic_py_lib.dataset.GoldListSettings[source]¶
Bases:
ds_common_serde_py_lib.SerializableScope for
list()againstGET /dataset/.- layers: list[ds_provider_aic_py_lib.enums.Layer] | None = None¶
Layers to include.
Nonedoes not filter by layer.
- limit: int = 100¶
Page size. Fetch accepts 1 to 500.
- fresh: bool = False¶
Send
Cache-Control: no-cachewhen true.