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.0a3.tar.gz (24.8 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.0a3-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ds_provider_mock_py_lib-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 17b1a6cb4c3c1e0f71df8e8ecca21fc422388d87b831c6b7164e1c66b6b9f704
MD5 944a94be124a43187ee4f53f54b603f9
BLAKE2b-256 9e4c3838584396c8d898a03d891e72914cb9ed3ef65930ca00df0f7251b7a273

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ds_provider_mock_py_lib-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 72ef13a2688f5142d7194914b35613f5cee7f5a539e56c6c640bb425225a99da
MD5 b115f27bee47c2426fbee48e8cca7a38
BLAKE2b-256 66394f621aabc991c994cc9f20f0f1c4c1136544df5ab4e4bf6134cfc0fb8d1f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0a3 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