Skip to main content

dq-kernel

Certifiable data-quality evidence engine for lakehouse pipelines. Semantically versioned rules, exact-arithmetic evaluation, and machine-checkable evidence — engine-agnostic by design.

Install

pip install dq-kernel[spark]

Requires Python 3.12/3.13. The Spark path needs Java 17 and a Spark 3.5.9 runtime.

Every release is built, signed and attested by the workflow that publishes it, and nothing is published before it has been checked. pip does not check attestations; the commands that do are under Releases and verifying them in the documentation.

Evidence can be kept in a SQL database instead of files. That sink and its Arrow path are optional extras: pip install dq-kernel[sqlalchemy,arrow].

Evidence can also come from other tools, without a Spark session: dq.harvest imports dbt test results, Great Expectations validation results, or a four-column CSV or JSON file, and dq-import applies the gate to them and writes the same dq-report/v1.

Portable rules also run with no Spark session at all, over Parquet, Arrow, CSV or JSON files, and write the same report: pip install 'dq-kernel[arrow]', then dq-run arrow_rule.conf --dataset orders=orders.parquet --report report.json. A rule opts in with adapter = "arrow". The same rules also run as one aggregate query on a database the data already lives in, through SQLAlchemy (adapter = "sql"; DuckDB is the certified lane).

A schema already written for pandera validates a pandas or a Polars frame through the same engine contract, and its results reach the same gate: pip install 'dq-kernel[pandera]'.

Runs are also judged by their history: with evidence kept in a SQL database, a policy reports stale data, a count that moved, a check failing for the first time, or a number that stands out of the series before it (examples/history_policies.conf).

A rule can also act on the rows a check rejected: with an engine that tags rows (DQX first), a rows block sorts the frame into valid and quarantined rows and writes each where it says (examples/dqx_row_outcomes.conf).

The same packs run on a stream: dq.streaming.per_batch builds the callback foreachBatch takes, and judges every micro-batch that carries rows (examples/streaming_validation.conf).

Start from the data instead of a blank rule pack: dq-profile summarizes a dataset, with Arrow or Spark, and dq-suggest turns the summary into a draft rule pack -- for the portable checks, Deequ, DQX or Great Expectations, in HOCON, YAML or JSON. Every rule in a draft is a warning under the gate policy where a warning blocks nothing, so a draft never stops a pipeline.

Quick start

from dq.dq_framework import DQFramework

results = DQFramework(spark, config, default_dataframe=df).run()

Each result carries check, success, and bounded details. Evidence is bound to dataset and rule-set digests as dq-report/v1.

A run explains itself: with nothing configured it is logged, one line per notification, naming the run and each rule (DQ_LOG_FORMAT=json for JSON lines). dq.observability is the port, with an OpenTelemetry adapter behind the otel extra.

Three semantic versions

Version Semantics Example
counts/v1 Completeness (present/rows) id is 80% complete
groups/v1 Grouped distinct-count bounds Each region has ≥ 2 distinct ids
ranges/v1 Value-range bounds All values ≥ 0 and ≤ 100

Plans are single-semantics: compose them with RulesetEnvelope for mixed rulesets and execute the whole ruleset with one call — dq.spark_adapter.execute_envelope(envelope, datasets) returns the aggregate verdict, and so does dq.arrow_adapter.execute_envelope, with no Spark: it takes a pyarrow table or a pandas, Polars or DataFusion frame.

Documentation

License

Apache-2.0

Metadata

Release files for dq-kernel 0.4.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 dq-kernel 0.4.0
File Size Uploaded Provenance Actions
dq_kernel-0.4.0.tar.gz 238.2 kB With provenance Details for dq_kernel-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dq-kernel 0.4.0
File Interpreter ABI Platform Actions
dq_kernel-0.4.0-py3-none-any.whl Python 3 none any Details for dq_kernel-0.4.0-py3-none-any.whl

Total release size: 532.8 kB

Release files / dq_kernel-0.4.0.tar.gz

Download URL dq_kernel-0.4.0.tar.gz
Size 238.2 kB
Tags Source
SHA-256 checksum
How to use checksums
35e5b2bbdc0e938b51e79d203a896f19b22a8e0e22b7400e61aa4df6c13d92d4
BLAKE2b-256 checksum
How to use checksums
a7dce01878c730ea044f592ddc4a6ad0ba5f1d8bb764e77da250c380a910b759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Release files / dq_kernel-0.4.0-py3-none-any.whl

Download URL dq_kernel-0.4.0-py3-none-any.whl
Size 294.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e7324335ba973078796a728f1cd70bc99667ca42df76fba37bec9ca45d7441c
BLAKE2b-256 checksum
How to use checksums
5621d8c80c757842821b9049eec26748dd14e38a3b672a8549f6404e7a3cf68f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for dq-kernel 0.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dq_kernel-0.4.0.tar.gz

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 Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files Full provenance

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