Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
V
Validata Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Validata
  • Validata Core
  • Issues
  • #2

Closed
Open
Opened Nov 09, 2018 by Christophe Benz@cbenzOwner0 of 2 tasks completed0/2 tasks

Enhance error messages of "pattern constraint" errors

Currently regex are used to match values against a pattern, but error messages quality is poor.

When pattern constraint is not used abusively (i.e. when it would have been OK to use a number), it's be possible to use a PEG grammar parser library or a parser library to produce better error messages.

Technical steps

  • create a custom check (named like PegCheck) taking a grammar and a column name (or many)
  • for each field using a pattern constraint:
    • don't use the pattern constraint in the schema, just use "type": "string"
    • explain in the field description the form of expected value
    • use examples (even if not yet supported, cf https://github.com/frictionlessdata/specs/issues/384)
    • configure the custom check for this field
  • define grammars outside, in .peg files, and reference them by path (?)

Resources

Parsers:

  • https://github.com/pyparsing/pyparsing

PEG grammars parsers:

  • https://github.com/erikrose/parsimonious
  • https://github.com/igordejanovic/Arpeggio
  • article: https://tomassetti.me/parsing-in-python/

Other approaches:

  • https://reparse.readthedocs.io/en/latest/
Edited Nov 15, 2018 by Christophe Benz
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: validata/validata-core#2

OpenDataFrance.net