ds_provider_aic_py_lib.dataset.gold¶
File: gold.py
Region: ds_provider_aic_py_lib/dataset/gold
Read-only dataset for an AIC gold table served by the fetch API.
The settings hold the published definition from ds-pipeline-infra.
This package does not own gold and does not write it.
read() requires SQL and posts it to POST /query/. Truncated pages
are followed inside that call. A resumed read assigns output from the
saved offset only.
Attributes¶
Classes¶
SQL sent to fetch for |
|
Scope for |
|
Published gold definition and the fetch scope for this dataset. |
|
Read-only gold dataset. Mutation methods are not supported. |
Module Contents¶
- ds_provider_aic_py_lib.dataset.gold.logger¶
- ds_provider_aic_py_lib.dataset.gold._FETCH_URL = 'https://grasp-daas.com/api/fetch/v1'¶
- class ds_provider_aic_py_lib.dataset.gold.GoldReadSettings[source]¶
Bases:
ds_common_serde_py_lib.SerializableSQL sent to fetch for
read().- sql: str¶
One statement for this dataset. Name it
gold. Another dataset is rejected.
- fresh: bool = False¶
Send
Cache-Control: no-cachewhen true.
- class ds_provider_aic_py_lib.dataset.gold.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.
- class ds_provider_aic_py_lib.dataset.gold.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().
- ds_provider_aic_py_lib.dataset.gold.AICGoldDatasetSettingsType¶
- ds_provider_aic_py_lib.dataset.gold.AICIdentityLinkedServiceType¶
- class ds_provider_aic_py_lib.dataset.gold.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.