Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table schema validator #125

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Add table schema validator #125

wants to merge 20 commits into from

Conversation

dalonsoa
Copy link
Collaborator

@dalonsoa dalonsoa commented Oct 23, 2024

Adds a table schema validator for the header. This validator checks that, if there is a schema keyword in the header, it follows the standard defined in the Table Schema specification (mostly). This is done via pydantic models, some of them nested, and some of them discriminated based on the field type_, like it is done in PyECN.

This PRs only implements the validation of the schema if present in the header of the file. It does not enforce it or does anything with it. That is a job for future PRs, as it will need to be adapted to each reader/writer.

As the validation.py module was becoming pretty big, I have split it into several submodules within validation package, and the same with the tests. So the changes look more massive than they actually are. Just focus on the following two files:

  • csvy/validators/table_schema.py
  • tests/validators/tests_table_schema.py

This PR incorporate the changes made in #169, dropping support for python 3.9 and adding support for 3.13. Ignore those changes or review that specific, already merged, PR.

Needless to say, there's no urgency on reviewing this.

Closes #3

Base automatically changed from registry to develop October 24, 2024 09:11
@dalonsoa dalonsoa changed the base branch from develop to main December 17, 2024 12:58
@dalonsoa dalonsoa marked this pull request as ready for review December 19, 2024 14:16
@dalonsoa dalonsoa changed the title WIP: Table validator Add table schema validator Dec 19, 2024
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.

Implement the Tabular Schema to declare tabular data
1 participant