Data Quality

A column profile: how complete, how varied, and what the values look like. Sample values are the fastest way to spot that a “date” column holds three different formats — no summary statistic catches that.

src/components/ui/data-quality.tsx

About

From the component's own source, where it was written.

A column profile: how complete, how varied, and what the values look like.

The three numbers that decide whether a column is usable, in the order you ask them:

**Nulls** — an 80%-null column is not a column you can join on, and the percentage is drawn as a bar because a number in a table is easy to skim past.

**Distinct** — one distinct value across a million rows is a constant masquerading as data; a million distinct values is an id, not a dimension. Both are flagged, because both mean the column will not do what a chart expects of it.

**Samples** — the fastest way to spot that a "date" column holds 01/02/2024, 2024-02-01 and Feb 1 in the same file. No summary statistic catches that; three example values do immediately.

Install

npx astralyx-ui add data-quality

Usage

import { DataQuality } from '@/components/ui/data-quality'

<DataQuality columns={profile} />

Composer

Change the props and the source below follows.

Column profile

  • idtextunique per row
    0% empty
    18,402 distinct
    cus_8812cus_8813
  • emailtext
    2% empty
    18,020 distinct
    ada@example.commarc@example.com
  • plantext
    0% empty
    3 distinct
    teamprofree
  • regiontextmostly empty
    68% empty
    12 distinct
    eu-west-2us-east-1
  • schema_versionintegersingle value
    0% empty
    1 distinctmin 3max 3
    3
  • signup_datetext
    1% empty
    402 distinct
    2026-03-1402/04/2026May 2026
Props
tsx
<DataQuality columns={profile} nullWarnAt={0.3} />

Examples

A constant, an id and a mostly-empty column

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

DataQuality

A column profile: how complete, how varied, and what the values look like.

Extends Omit<ComponentProps<'div'>, 'children'>.

PropTypeDefaultDescription
columnsColumnProfile[]required{ name, type?, nullFraction?, distinct?, total?, min?, max?, samples? }.
nullWarnAtnumber0.3Null fraction above this is flagged.
constantLabelstring'single value'—
uniqueLabelstring'unique per row'—
sparseLabelstring'mostly empty'—
emptyLabelstring'Nothing profiled.'—
labelstring'Column profile'—

Types

ColumnProfile

FieldTypeDescription
namestring—
type?string—
nullFraction?numberFraction 0–1.
distinct?numberOne distinct value is a constant masquerading as data; one per row is an id, not a dimension. Both are flagged, because both break what a chart expects.
total?numberTotal rows profiled, for the distinct ratio.
min?ReactNode—
max?ReactNode—
samples?string[]Real values. The fastest way to see mixed formats hiding behind a clean-looking type.