Skip to content

Add validate command and release 1.0.0 - #11

Merged
rmkr-dev merged 1 commit into
mainfrom
feat/validate-command
Oct 16, 2026
Merged

rmkr-dev merged 1 commit into
mainfrom
feat/validate-command

Conversation

@rmkr-dev

Copy link
Copy Markdown
Owner

What

Adds a validate command and releases 1.0.0.

validate [file] checks a list of records (or a single object) before it moves further down a pipeline:

  • -r, --require PATH — path must be present (null counts as present)
  • --type PATH=TYPE[|TYPE...] — string, integer, number, boolean, object, array, null
  • -u, --unique PATH — no repeated values across records (same labels as group-by / join)
  • -s, --schema FILE — JSON or YAML with required, types, unique; flags are added on top
  • --coerce — numeric, true/false, and empty strings satisfy integer, number, boolean, null (for CSV)
  • --max-errors N, -q, --quiet

The report is {"valid", "records", "error_count", "errors"}. With -t csv or -t ndjson only the error rows are written, which works well as a CI artifact.

Exit codes: 0 valid, 1 invalid, 2 the check could not run.

data-transform validate -s users.schema.yaml --coerce users.csv -t csv -o validation-errors.csv

1.0.0

  • Version bumped to 1.0.0 in pyproject.toml and __version__.
  • README gains a Validate section and a Stability section describing what 1.0.0 commits to.
  • CHANGELOG entry for 1.0.0.
  • New package CI job: builds the sdist and wheel, installs the wheel in a clean venv, smoke-tests data-transform (including the exit codes), and uploads dist/.

Tests

  • New tests/test_validate.py (14 tests) covering required paths, type unions, coercion, uniqueness, object roots, non-object records, error caps, schema loading, and CLI exit codes 0 / 1 / 2.
  • Full suite: 150 passed locally on Python 3.13.

validate checks a list of records (or one object) for required dotted
paths, value types, and unique keys, from flags or a JSON/YAML schema
file. It exits 0 when valid, 1 when not, and 2 when the check cannot
run, so it can gate a pipeline step. --coerce lets CSV strings satisfy
integer, number, boolean, and null, and -t csv writes only the error
rows.

Also bumps the version to 1.0.0, adds a Stability section to the
README, and adds a CI job that builds the sdist and wheel, installs the
wheel in a clean venv, and smoke-tests the command.
@rmkr-dev
rmkr-dev merged commit dde526a into main Oct 16, 2026
3 checks passed
@rmkr-dev
rmkr-dev deleted the feat/validate-command branch October 16, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant