Skip to main content

pytest-ditto-polars

A pytest-ditto plugin for polars DataFrame snapshots.

Documentation

Installation

pip install "pytest-ditto[polars]"

Marks

  • @ditto.polars.parquet
  • @ditto.polars.ipc
  • @ditto.polars.csv
  • @ditto.polars.ndjson

Each mark is shorthand for @ditto.record("<name>").

Use @ditto.polars.parquet or @ditto.polars.ipc: CSV and NDJSON infer types again on load. See the format notes in the documentation.

Usage

import polars as pl
import polars.testing

import ditto


def awesome_fn_to_test(df: pl.DataFrame) -> pl.DataFrame:
    return df.with_columns(pl.col("a") * 2)


# The following test uses polars.DataFrame.write_parquet to write the data snapshot
# to the `.ditto` directory with filename:
# `<module>.test_fn_with_parquet_dataframe_snapshot@ab_dataframe~<hash>.polars.parquet`.


@ditto.polars.parquet
def test_fn_with_parquet_dataframe_snapshot(snapshot):
    input_data = pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 9]})
    result = awesome_fn_to_test(input_data)
    pl.testing.assert_frame_equal(result, snapshot(result, key="ab_dataframe"))

Metadata

Release files for pytest-ditto-polars 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-ditto-polars 2.0.0
File Size Uploaded
pytest_ditto_polars-2.0.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-ditto-polars 2.0.0
File Interpreter ABI Platform
pytest_ditto_polars-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.5 kB

Release files / pytest_ditto_polars-2.0.0.tar.gz

Download URL pytest_ditto_polars-2.0.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fbc6e8825055efb9aaacffdc6c452371f58ce4f162470abd95c079483929f43a
BLAKE2b-256 checksum
How to use checksums
cf0f34d9008b6118bb3327821b2257caa4e3f57e56d7454892c99e6f20ea6135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pytest_ditto_polars-2.0.0-py3-none-any.whl

Download URL pytest_ditto_polars-2.0.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d98c7fb404b7cd4c0881244b0f3ddc4a7d7a0fc18a87a714c9b8c2817e6e4a2f
BLAKE2b-256 checksum
How to use checksums
4dcb1c10fe81172f2aec46d3a00e55efed03d4c3a109198c501763515ce2558a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page