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

Improve the error message when a column is missing from the schema #216

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

nanne-aben
Copy link
Collaborator

The message now reads something like:

Data contains the following columns not present in schema B: {'c', 'd', 'a'}.

If you believe these columns should be part of the schema, consider adding the following lines to it.

class B(Schema):
    c: Column[ArrayType[StringType]]
    d: Column[StructType[D]]
    a: Column[IntegerType]


class D(Schema):
    e: Column[IntegerType]

This is particularly useful in automated pipelines. If new columns are added to the underlying data, it's nice to know what needs to be changed in the schema.

@nanne-aben nanne-aben enabled auto-merge (squash) November 7, 2023 15:21
@nanne-aben nanne-aben merged commit 3abf4b5 into main Nov 7, 2023
4 checks passed
@nanne-aben nanne-aben deleted the better-error-msg branch November 7, 2023 15:27
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.

3 participants