← Workflows

阅读中文版本

Data Quality Threshold Gate Workflow

Set pass thresholds on freshness, null rate, and volume so a pipeline halts or warns when data quality drops.

intermediate~50 mindataqualitypipeline

Objective

Gate pipeline stages on measurable data-quality thresholds.

Environment

  • A quality framework
  • Baseline metrics
  • Alerting

Steps

1. Define quality metrics

Choose metrics such as freshness, null rate, and row-count deviation with acceptable ranges.

Expected state: Each metric has a numeric threshold.

2. Measure before promotion

Evaluate the metrics on the produced dataset before publishing.

Expected state: Every run produces a quality scorecard.

3. Block or warn on breach

Halt the load on hard breaches and warn on soft ones.

Expected state: Bad data does not reach consumers silently.

4. Track trends over time

Watch metric trends to catch slow degradation.

Expected state: Gradual quality loss is detected early.

Decision points

Block or warn?

  • Block on critical, warn on soft
  • Warn on everything

Block on critical metrics that would mislead consumers.

Static or dynamic thresholds?

  • Dynamic from history
  • Fixed numbers

Use history-based thresholds where seasonality matters.

Expected outcome

Only data that meets quality thresholds reaches consumers, with soft breaches surfaced for review.

Verification

Confirm a dataset breaching a hard threshold is blocked and a soft breach raises a warning.

Cleanup

Tune thresholds periodically and document rationale for each.

Overview

Gate pipeline stages on measurable data-quality thresholds.

This workflow is reusable across teams and environments; adapt the commands to your tooling while keeping the sequence and checkpoints intact.

Environment and prerequisites

  • A quality framework
  • Baseline metrics
  • Alerting

Procedure

1. Define quality metrics

Choose metrics such as freshness, null rate, and row-count deviation with acceptable ranges.

Expected state: Each metric has a numeric threshold.

2. Measure before promotion

Evaluate the metrics on the produced dataset before publishing.

Expected state: Every run produces a quality scorecard.

3. Block or warn on breach

Halt the load on hard breaches and warn on soft ones.

Expected state: Bad data does not reach consumers silently.

Watch metric trends to catch slow degradation.

Expected state: Gradual quality loss is detected early.

# fail the load when freshness or null rate breaches
python check_quality.py --freshness-minutes 60 --null-rate-max 0.01 || exit 1

Verification

Confirm a dataset breaching a hard threshold is blocked and a soft breach raises a warning.

Decision points

Block or warn?

  • Block on critical, warn on soft
  • Warn on everything

Recommendation: Block on critical metrics that would mislead consumers.

Static or dynamic thresholds?

  • Dynamic from history
  • Fixed numbers

Recommendation: Use history-based thresholds where seasonality matters.

Common failures

  • No thresholds means bad data ships.
  • Warning-only on critical metrics lets errors through.
  • Fixed thresholds ignore seasonality.