ds_provider_mock_py_lib.dataset.settings ======================================== .. py:module:: ds_provider_mock_py_lib.dataset.settings .. autoapi-nested-parse:: **File:** ``settings.py`` **Region:** ``ds_provider_mock_py_lib/dataset`` Dataset settings for the mock provider. .. rubric:: 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 ------- .. autoapisummary:: ds_provider_mock_py_lib.dataset.settings.MockColumn ds_provider_mock_py_lib.dataset.settings.MockDatasetSettings Functions --------- .. autoapisummary:: ds_provider_mock_py_lib.dataset.settings.default_columns Module Contents --------------- .. py:class:: MockColumn Bases: :py:obj:`ds_common_serde_py_lib.Serializable` One synthetic column in a mock dataset. .. py:attribute:: name :type: str Column name emitted in ``self.output``. .. py:attribute:: kind :type: ds_provider_mock_py_lib.enums.ColumnKind Value generator used for this column. .. py:attribute:: value :type: Any :value: None Payload for ``constant`` and ``enum``. A scalar is emitted on every row when ``kind`` is ``constant``. A non-empty list is sampled when ``kind`` is ``enum``. .. py:attribute:: prefix :type: str :value: '' Prefix used when ``kind`` is ``text``. .. py:attribute:: low :type: int :value: 0 Inclusive lower bound for random numeric kinds. .. py:attribute:: high :type: int :value: 1000 Exclusive upper bound for random numeric kinds. .. py:attribute:: null_every :type: int | None :value: None When set, every Nth id is ``None`` (stable across batches). .. py:function:: default_columns() -> list[MockColumn] Return the default mock column set. :returns: A sequence column named ``id`` and a text column named ``name``. .. py:class:: MockDatasetSettings Bases: :py:obj:`ds_resource_plugin_py_lib.common.resource.dataset.DatasetSettings` Settings that define mock read scope and injected failure behaviour. .. py:attribute:: columns :type: list[MockColumn] Synthetic columns included in every emitted row. .. py:attribute:: row_count :type: int :value: 100 Rows in the full load (batch 0, all inserts). .. py:attribute:: incremental_insert_count :type: int :value: 0 New unique primary keys delivered in each incremental batch. .. py:attribute:: incremental_update_count :type: int :value: 0 Existing primary keys re-delivered with changed column values (row hash changes). .. py:attribute:: incremental_noop_count :type: int :value: 0 Existing primary keys re-delivered with an identical row (same hash). .. py:attribute:: page_size :type: int | None :value: None Page size. ``None`` emits the whole batch in one page. .. py:attribute:: seed :type: int :value: 42 Determinism seed for id selection and random cell values. .. py:attribute:: page_delay_ms :type: int :value: 0 Artificial delay applied after each successful page. .. py:attribute:: op_column :type: str | None :value: 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"]``. .. py:attribute:: modified_at_column :type: str :value: '_modified_at' Column that stores the deterministic modified-at timestamp. .. py:attribute:: raise_on_page :type: int | None :value: None 1-based page number within the current batch that should fail. ``None`` disables. .. py:attribute:: raise_as :type: ds_provider_mock_py_lib.enums.RaiseAs Contract exception class used when ``raise_on_page`` matches. .. py:attribute:: raise_error :type: ds_provider_mock_py_lib.models.MockError Error spec used when ``raise_on_page`` matches.