ds_provider_mock_py_lib.dataset.engines¶
File: __init__.py
Region: ds_provider_mock_py_lib/dataset/engines
Dataset execution engines.
Submodules¶
Classes¶
Execute mock reads including pagination, resume, and failure injection. |
Package Contents¶
- class ds_provider_mock_py_lib.dataset.engines.ReadEngine[source]¶
Execute mock reads including pagination, resume, and failure injection.
- dataset_name: str¶
- provider_type: str¶
- output: pandas.DataFrame¶
- metadata: dict[str, Any]¶
- _emitted_ops: list[str] = []¶
- execute(checkpoint: dict[str, Any] | None = None) None[source]¶
Execute read flow and update
output/checkpointstate.- Parameters:
checkpoint – Existing checkpoint state to continue from.
- Raises:
ReadError – If settings are invalid or a wrapped backend failure occurs.
ConnectionError – If dataset-level injection is configured as a connection error.
MockBackendError – If the mock backend raises and the caller must wrap it.
- _resolve_start() tuple[int, int, bool][source]¶
Resolve batch, first page, and whether this call is a resume.
- Returns:
(batch, first_page, resumed).- Raises:
ReadError – If a stored pagination cursor cannot be decoded.
- _save_pagination(*, batch: int, page: int) None[source]¶
Persist pagination resume state without advancing the watermark.
- _assign_output(pages: list[pandas.DataFrame]) None[source]¶
Assign concatenated pages to
output, including rows already read on failure.- Parameters:
pages – Pages collected so far in this read.
- _finish_complete(*, batch: int, pages: list[pandas.DataFrame], total_pages: int, resumed: bool) None[source]¶
Complete a successful read of the configured scope.
- Parameters:
batch – Completed batch number written to the incremental watermark.
pages – Pages collected during this read.
total_pages – Page count for the current batch.
resumed – Whether this call continued from a pagination cursor.