Skip to content

Improve validation for Headers and Columns #12

@kosack

Description

@kosack

Problem

  1. Currently all possible validators are options in the constructor of HeaderCard or Column. This is not very flexible, and means there are e.g. string validation options for numerical values, etc.
  2. We don't have a way to validate things like UCDs, or UUIDs, which are strings.

Proposed Solution(s)

  1. Change how type=x are specified to use a Type class hierarchy, which has validators inside. Then you just giev e.g. Column(type=UUID,...)
  2. Allow a list of "validator classes" (independent of type), like in pydantic, e.g. HeaderCard(validators=[ValidUUID, MaxLength(50)]). That may be more flexible if there are many types of validation, but it's a bit more wordy and the same can be achieved by (1)

Required header checks:

These are needed for doing proper validation of headers (and maybe also columns in some cases):

  • is valid ISO time string (needed for DATE* headers)
  • is valid MJD (maybe range min/max is enough however)
  • is valid unit (needed for TIMEUNIT header)
  • is valid UUID (needed for data product IDs)
  • is valid URI or Path (needed for GROUP tables)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions