Skip to main content

Data Validation Everyone Can Read

AI / Agents

Skills
llms.txt
llms-full.txt

Developers

Richard Iannone

Maintainer

Posit, PBC

Posit Software, PBC

Copyright holder, funder

Community

Contributing guide
Code of conduct
Project roadmap
Security policy
Full license MIT
Citing pointblank

Meta

Requires: Python >=3.10
Provides-Extra: pd, pl, pyspark, generate, mcp, otel, excel, cdisc, ml, cdisc-core, bigquery, databricks, duckdb, mysql, mssql, postgres, snowflake, sqlite, docs
Package Info

Pointblank checks your tables for the problems that matter (missing values, out-of-range numbers, malformed text, duplicate rows) and reports what it finds in tables that analysts, engineers, and stakeholders can all read.

A validation, one part at a time

A validation is a table, a plan of checks, and a report. Step through this one to see what each part adds, with the new lines of code highlighted.

Data

Start with a table: Polars, Pandas, a DuckDB or Spark table, a database table, or a CSV or Parquet file. pb.preview() shows its first and last rows and its column types.

import pointblank as pb

small_table = pb.load_dataset("small_table")

pb.preview(small_table)
PolarsRows13Columns8
date_time
Datetime
date
Date
a
Int64
b
String
c
Int64
d
Float64
e
Boolean
f
String
1 2016-01-04 11:00:00 2016-01-04 2 1-bcd-345 3 3423.29 True high
2 2016-01-04 00:32:00 2016-01-04 3 5-egh-163 8 9999.99 True low
3 2016-01-05 13:32:00 2016-01-05 6 8-kdg-938 3 2343.23 True high
4 2016-01-06 17:23:00 2016-01-06 2 5-jdo-903 None 3892.4 False mid
5 2016-01-09 12:36:00 2016-01-09 8 3-ldm-038 7 283.94 True low
9 2016-01-20 04:30:00 2016-01-20 3 5-bce-642 9 837.93 False high
10 2016-01-20 04:30:00 2016-01-20 3 5-bce-642 9 837.93 False high
11 2016-01-26 20:07:00 2016-01-26 4 2-dmx-010 7 833.98 True low
12 2016-01-28 02:51:00 2016-01-28 2 7-dmx-010 8 108.34 False low
13 2016-01-30 11:23:00 2016-01-30 1 3-dka-303 None 2230.09 True high

Plan

Say what good data looks like, one check per step. There are checks for values, text patterns, sets, missing values, duplicates, row counts, schemas, and more. Before the checks are run, the report shows the plan.

(
    pb.Validate(
        data=small_table,
        tbl_name="small_table",
        label="Checks on the sales data",
    )
    .col_vals_gt(columns="d", value=1000)
    .col_vals_not_null(columns="c")
    .col_vals_regex(columns="b", pattern=r"^\d-[a-z]{3}-\d{3}$")
    .col_vals_in_set(columns="f", set=["low", "mid", "high"])
    .rows_distinct()
)
Pointblank ValidationNo Interrogation Performed
Checks on the sales data
Polarssmall_table
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#4CA64C66 1
col_vals_gt
col_vals_gt()
d 1000 —
#4CA64C66 2
col_vals_not_null
col_vals_not_null()
c — —
#4CA64C66 3
col_vals_regex
col_vals_regex()
b ^\d-[a-z]{3}-\d{3}$ —
#4CA64C66 4
col_vals_in_set
col_vals_in_set()
f low, mid, high —
#4CA64C66 5
rows_distinct
rows_distinct()
ALL COLUMNS — —

Thresholds

Decide how much failure is too much. Thresholds set the share of failing rows that counts as a warning, an error, or a critical problem, and actions can run when one is reached.

(
    pb.Validate(
        data=small_table,
        tbl_name="small_table",
        label="Checks on the sales data",
        thresholds=pb.Thresholds(warning=0.05, error=0.10, critical=0.15),
    )
    .col_vals_gt(columns="d", value=1000)
    .col_vals_not_null(columns="c")
    .col_vals_regex(columns="b", pattern=r"^\d-[a-z]{3}-\d{3}$")
    .col_vals_in_set(columns="f", set=["low", "mid", "high"])
    .rows_distinct()
)
Pointblank ValidationNo Interrogation Performed
Checks on the sales data
Polarssmall_tableWARNING0.05ERROR0.1CRITICAL0.15
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#4CA64C66 1
col_vals_gt
col_vals_gt()
d 1000 —
#4CA64C66 2
col_vals_not_null
col_vals_not_null()
c — —
#4CA64C66 3
col_vals_regex
col_vals_regex()
b ^\d-[a-z]{3}-\d{3}$ —
#4CA64C66 4
col_vals_in_set
col_vals_in_set()
f low, mid, high —
#4CA64C66 5
rows_distinct
rows_distinct()
ALL COLUMNS — —

Report

Run the checks with interrogate(). The report shows every step: how many rows passed and failed, which thresholds were reached, and a CSV of the failing rows. With brief=True, each step also says in plain words what it checks.

(
    pb.Validate(
        data=small_table,
        tbl_name="small_table",
        label="Checks on the sales data",
        brief=True,
        thresholds=pb.Thresholds(warning=0.05, error=0.10, critical=0.15),
    )
    .col_vals_gt(columns="d", value=1000)
    .col_vals_not_null(columns="c")
    .col_vals_regex(columns="b", pattern=r"^\d-[a-z]{3}-\d{3}$")
    .col_vals_in_set(columns="f", set=["low", "mid", "high"])
    .rows_distinct()
    .interrogate()
)
Pointblank Validation
Checks on the sales data
Polarssmall_tableWARNING0.05ERROR0.1CRITICAL0.15
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#FF3300 1
col_vals_gt
col_vals_gt()

Expect that values in d should be > 1000.

d 1000 ✓ 13 7
0.54
6
0.46
● ● ●
#FF3300 2
col_vals_not_null
col_vals_not_null()

Expect that all values in c should not be Null.

c — ✓ 13 11
0.85
2
0.15
● ● ●
#4CA64C 3
col_vals_regex
col_vals_regex()

Expect that values in b should match the regular expression: ^\d-[a-z]{3}-\d{3}$.

b ^\d-[a-z]{3}-\d{3}$ ✓ 13 13
1.00
0
0.00
○ ○ ○ —
#4CA64C 4
col_vals_in_set
col_vals_in_set()

Expect that values in f should be in the set of low, mid, high.

f low, mid, high ✓ 13 13
1.00
0
0.00
○ ○ ○ —
#FF3300 5
rows_distinct
rows_distinct()

Expect entirely distinct rows across all columns.

ALL COLUMNS — ✓ 13 11
0.85
2
0.15
● ● ●
2026-11-26 18:49:25 UTC< 1 s2026-11-26 18:49:25 UTC

Validation reports Thresholds Validation methods

See exactly what failed

A failing step is a starting point, not a dead end. Open any step in a report of its own, pull out the rows that failed, or split the table into its passing and failing rows.

A step’s own report

The rows where c is missing, with the failing values highlighted.

validation.get_step_report(i=2)
Report for Validation Step 2 ✗
ASSERTION c is Not Null
2 / 13 TEST UNIT FAILURES IN COLUMN 5
EXTRACT OF ALL 2 ROWS (WITH TEST UNIT FAILURES IN RED):
date_time
Datetime
date
Date
a
Int64
b
String
c
Int64
d
Float64
e
Boolean
f
String
4 2016-01-06 17:23:00 2016-01-06 2 5-jdo-903 None 3892.4 False mid
13 2016-01-30 11:23:00 2016-01-30 1 3-dka-303 None 2230.09 True high

The failing rows

The rows where d isn’t over 1,000, as a table of their own.

pb.preview(validation.get_data_extracts(i=1, frame=True))
PolarsRows6Columns9
date_time
Datetime
date
Date
a
Int64
b
String
c
Int64
d
Float64
e
Boolean
f
String
5 2016-01-09 12:36:00 2016-01-09 8 3-ldm-038 7 283.94 True low
7 2016-01-15 18:46:00 2016-01-15 7 1-knw-093 3 843.34 True high
9 2016-01-20 04:30:00 2016-01-20 3 5-bce-642 9 837.93 False high
10 2016-01-20 04:30:00 2016-01-20 3 5-bce-642 9 837.93 False high
11 2016-01-26 20:07:00 2016-01-26 4 2-dmx-010 7 833.98 True low
12 2016-01-28 02:51:00 2016-01-28 2 7-dmx-010 8 108.34 False low

Split the table

Every row that failed any step, ready for a quarantine table.

pb.preview(validation.get_sundered_data(type="fail"))
PolarsRows8Columns8
date_time
Datetime
date
Date
a
Int64
b
String
c
Int64
d
Float64
e
Boolean
f
String
1 2016-01-06 17:23:00 2016-01-06 2 5-jdo-903 None 3892.4 False mid
2 2016-01-09 12:36:00 2016-01-09 8 3-ldm-038 7 283.94 True low
3 2016-01-15 18:46:00 2016-01-15 7 1-knw-093 3 843.34 True high
4 2016-01-20 04:30:00 2016-01-20 3 5-bce-642 9 837.93 False high
5 2016-01-20 04:30:00 2016-01-20 3 5-bce-642 9 837.93 False high
6 2016-01-26 20:07:00 2016-01-26 4 2-dmx-010 7 833.98 True low
7 2016-01-28 02:51:00 2016-01-28 2 7-dmx-010 8 108.34 False low
8 2016-01-30 11:23:00 2016-01-30 1 3-dka-303 None 2230.09 True high

Step reports Data extracts Sundering data

Runs where your data lives

Pointblank works through Narwhals and Ibis, so the same plan runs unchanged on DataFrames and in databases, and the checks happen where the data is.

Polars Pandas PyArrow DuckDB PySpark Snowflake BigQuery Databricks PostgreSQL MySQL SQL Server SQLite CSV and Parquet

Installation

And when you need more

Validation is the core, and everything else builds on it.

Contracts and pipelines

Reusable data contracts, checked where data comes in and where it goes out. Import JSON Schema and Frictionless.

Data contracts →

YAML and the CLI

Keep plans in YAML for review, and run them with pb in CI, with exit codes and extracts.

YAML workflows →

Plans drafted by AI

Get a first plan from a model that looked at your table, then revise it in plain English.

Drafting plans →

Comparing tables

Find the rows and values that differ between two tables, even across backends and large files.

Comparing tables →

Data for machine learning

Check training splits, synthetic data, and text, then measure which failing rows hurt a model.

Data ablation →

Look before you validate

Previews, column summaries, and missing-value maps to see what a table holds.

Data inspection →

Test data

Generate realistic data from a schema, in 100+ locales, as a pytest fixture.

Generating test data →

Clinical and metadata standards

CDISC SDTM and ADaM, Define-XML, and metadata from SPSS, SAS, and Stata files.

Metadata import →

Agents and observability

An MCP server and Agent Skills for AI assistants, and OpenTelemetry traces and metrics.

MCP quick start →

Get started

Install Pointblank from PyPI:

pip install pointblank

Then make your first validation in the Quickstart, or look through the Demos for ideas. Reports come in 40 languages.