Edit page in Livemark
(2022-09-19 18:33)

Baseline Check

Overview

The Baseline Check is always enabled. It makes various small checks that reveal a great deal of tabular errors. You can create an empty Checklist to see the baseline check scope:

Download capital-invalid.csv to reproduce the examples (right-click and "Save link as")..

from pprint import pprint
from frictionless import Checklist, validate

checklist = Checklist()
pprint(checklist.scope)
report = validate('capital-invalid.csv')  # we don't pass the checklist as the empty one is default
pprint(report.flatten(['type', 'message']))
['md5-count',
 'sha256-count',
 'byte-count',
 'field-count',
 'row-count',
 'blank-header',
 'extra-label',
 'missing-label',
 'blank-label',
 'duplicate-label',
 'incorrect-label',
 'blank-row',
 'primary-key',
 'foreign-key',
 'extra-cell',
 'missing-cell',
 'type-error',
 'constraint-error',
 'unique-error']
[['duplicate-label',
  'Label "name" in the header at position "3" is duplicated to a label: at '
  'position "2"'],
 ['missing-cell',
  'Row at position "10" has a missing cell in field "name2" at position "3"'],
 ['blank-row', 'Row at position "11" is completely blank'],
 ['type-error',
  'Type error in the cell "x" in row "12" and field "id" at position "1": type '
  'is "integer/default"'],
 ['extra-cell',
  'Row at position "12" has an extra value in field at position "4"']]

The Baseline Check is incorporated into base Frictionless classes as though Resource, Header, and Row. There is no exact order in which those errors are revealed as it's highly optimized. One should consider the Baseline Check as one unit of validation.

Reference

checks.baseline (class)

checks.baseline (class)

Check a table for basic errors Ths check is enabled by default for any `validate` function run.

Signature

(*, title: Optional[str] = None, description: Optional[str] = None) -> None

Parameters

  • title (Optional[str])
  • description (Optional[str])

checks.baseline.type (property)

Signature

ClassVar[str]

checks.baseline.Errors (property)

Signature

ClassVar[List[Type[Error]]]

checks.baseline.title (property)

Signature

Optional[str]

checks.baseline.description (property)

Signature

Optional[str]

It's a beta version of Frictionless Framework (v5). Read Frictionless Framework (v4) docs for a version that is currently installed by default by pip.