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.0a2.tar.gz (24.6 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.0a2-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ds_provider_mock_py_lib-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 448c6b1ec2658bfcdfb1b52e4aa0746f98a6598a05d10740c68ac27aa8248ac1
MD5 63529393d5bcdc534b096a1cdd674e33
BLAKE2b-256 ee8236db252a71350e761edc9d0160f4cf57c9e7b1fc7b7efb1077aa458cc261

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ds_provider_mock_py_lib-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 278b9975bf89a9f711bbe9cd51f93bc3660f5d43f45943912d265f09cc0bfea5
MD5 be8ce665da12af7181130cf13da25a01
BLAKE2b-256 7e95cc2f481e4584ba2cc7238070499d7f18109d4b93b46908e8f97772c4fcf4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

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