ds_provider_mock_py_lib.dataset.settings¶
File: settings.py
Region: ds_provider_mock_py_lib/dataset
Dataset settings for the mock provider.
Example
>>> from ds_provider_mock_py_lib.dataset.settings import MockColumn, MockDatasetSettings
>>> from ds_provider_mock_py_lib.enums import ColumnKind
>>> settings = MockDatasetSettings(
... columns=[
... MockColumn(name="id", kind=ColumnKind.SEQUENCE),
... MockColumn(name="status", kind=ColumnKind.ENUM, value=["active", "deactive"]),
... ],
... row_count=10,
... )
>>> settings.row_count
10
Classes¶
One synthetic column in a mock dataset. |
|
Settings that define mock read scope and injected failure behaviour. |
Functions¶
|
Return the default mock column set. |
Module Contents¶
- class ds_provider_mock_py_lib.dataset.settings.MockColumn[source]¶
Bases:
ds_common_serde_py_lib.SerializableOne synthetic column in a mock dataset.
- name: str¶
Column name emitted in
self.output.
- kind: ds_provider_mock_py_lib.enums.ColumnKind¶
Value generator used for this column.
- value: Any = None¶
Payload for
constantandenum.A scalar is emitted on every row when
kindisconstant. A non-empty list is sampled whenkindisenum.
- prefix: str = ''¶
Prefix used when
kindistext.
- low: int = 0¶
Inclusive lower bound for random numeric kinds.
- high: int = 1000¶
Exclusive upper bound for random numeric kinds.
- null_every: int | None = None¶
When set, every Nth id is
None(stable across batches).
- ds_provider_mock_py_lib.dataset.settings.default_columns() list[MockColumn][source]¶
Return the default mock column set.
- Returns:
A sequence column named
idand a text column namedname.
- class ds_provider_mock_py_lib.dataset.settings.MockDatasetSettings[source]¶
Bases:
ds_resource_plugin_py_lib.common.resource.dataset.DatasetSettingsSettings that define mock read scope and injected failure behaviour.
- columns: list[MockColumn]¶
Synthetic columns included in every emitted row.
- row_count: int = 100¶
Rows in the full load (batch 0, all inserts).
- incremental_insert_count: int = 0¶
New unique primary keys delivered in each incremental batch.
- incremental_update_count: int = 0¶
Existing primary keys re-delivered with changed column values (row hash changes).
- incremental_noop_count: int = 0¶
Existing primary keys re-delivered with an identical row (same hash).
- page_size: int | None = None¶
Page size.
Noneemits the whole batch in one page.
- seed: int = 42¶
Determinism seed for id selection and random cell values.
- page_delay_ms: int = 0¶
Artificial delay applied after each successful page.
- op_column: str | None = None¶
Optional label column for intended row kind.
Gold merge uses primary key plus row hash, not this column. Leave unset so the label cannot change the hash of a noop row. Counts are always in
operation.metadata["ops"].
- modified_at_column: str = '_modified_at'¶
Column that stores the deterministic modified-at timestamp.
- raise_on_page: int | None = None¶
1-based page number within the current batch that should fail.
Nonedisables.
- raise_as: ds_provider_mock_py_lib.enums.RaiseAs¶
Contract exception class used when
raise_on_pagematches.
- raise_error: ds_provider_mock_py_lib.models.MockError¶
Error spec used when
raise_on_pagematches.