Skip to content

Schema decision: the canonical dtype vocabulary for schema.columns #122

Description

@mmcky

Every schema.columns entry declares a dtype, and the invariant tests in PLAN Phase 5 are meant to check it. Across the 41 manifests the vocabulary today is:

value occurrences
float64 126
float32 57
int64 49
str 43
string 21
object 9
datetime64 2
datetime 2

Three names for text (str, string, object) and two for dates, so no validator can compare a declared dtype with what pandas reads without a mapping. Business_cycle's manifest says str where manifest-schema.yml's example says string.

To decide.

  1. The canonical set: pandas dtype strings (float64, int64, string, datetime64[ns], bool, category) is the obvious candidate since validate() will compare against a pandas frame; whether float32 stays as a distinct declaration or collapses to float.
  2. What the check means for a CSV: a CSV has no dtypes, so the declaration is a statement about what pd.read_csv with the manifest's read options yields. Whether the manifest records those read options (index_col, parse_dates) or the check uses pandas defaults.
  3. Text columns: string versus object, given the lectures read with default pandas settings that yield object.
  4. Migration: a one-time normalisation pass over the manifests once the set is fixed, and a manifest-schema.yml conformance check that rejects anything outside it.

Sub-issue of #14.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions