Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ds-provider-mock-py-lib

Mock provider for DS pipeline e2e testing. Read-only, deterministic, CDC-style change batches that bronze can load as a real ds.providers plugin.

Installation

pip install ds-provider-mock-py-lib

Or using uv:

uv pip install ds-provider-mock-py-lib

Quick Start

from uuid import uuid4

from ds_provider_mock_py_lib import (
    MockDataset,
    MockDatasetSettings,
    MockLinkedService,
    MockLinkedServiceSettings,
)

linked_service = MockLinkedService(
    id=uuid4(),
    name="mock-ls",
    version="1.0.0",
    settings=MockLinkedServiceSettings(),
)
dataset = MockDataset(
    id=uuid4(),
    name="mock-ds",
    version="1.0.0",
    linked_service=linked_service,
    settings=MockDatasetSettings(row_count=25),
)

linked_service.connect()
dataset.read()
assert len(dataset.output.index) == 25
linked_service.close()

Features

  • Deterministic snapshot and incremental CDC batches
  • Scriptable connect, auth, and per-request failures
  • Xledger-style checkpoint (incremental + pagination)
  • Pagination resume after injected read failures

Usage

Full load then one incremental change batch:

dataset.settings.incremental_insert_count = 5
dataset.settings.incremental_update_count = 3
dataset.settings.incremental_noop_count = 2

dataset.checkpoint = {}
dataset.read()  # batch 0, all inserts
state = dataset.checkpoint

dataset.checkpoint = state
dataset.read()  # batch 1: new keys, changed hashes, identical re-delivery

Requirements

  • Python 3.11 or higher
  • ds-resource-plugin-py-lib
  • pandas

Documentation

Full documentation is available at:

Development

git clone https://github.com/grasp-labs/ds-provider-mock-py-lib.git
cd ds-provider-mock-py-lib
uv sync --all-extras --dev
make test

See the README for more information.

License

This package is licensed under the Apache License 2.0. See the LICENSE-APACHE file for details.

Support

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ds_provider_mock_py_lib-0.1.0a1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ds_provider_mock_py_lib-0.1.0a1-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file ds_provider_mock_py_lib-0.1.0a1.tar.gz.

File metadata

File hashes

Hashes for ds_provider_mock_py_lib-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 9ecfd03345ceb78b6789112aa2a6421a5ea345c49dfae18c0bad7ca86e3a6a0a
MD5 1df55709f036e7b57cbc6658d0e83281
BLAKE2b-256 2abaf2b07ae2452d64dcadf932f9bb91e1825d5c4a1f3bb30e6da8414c9672fc

See more details on using hashes here.

File details

Details for the file ds_provider_mock_py_lib-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ds_provider_mock_py_lib-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9633a8988364c09d69692bf2c066ccace573acdc89ec1037d5289e68b771fdb
MD5 aba9d570ce41ed06524d3516104da589
BLAKE2b-256 635b1fb5154cceb5fb2be824a26fe1702592ce6e59b56caa03e7dcb46777d029

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page