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

Update the validate methods to return a boolean value, so they can be used for control flow #51

Open
MrPowers opened this issue Feb 11, 2023 · 0 comments

Comments

@MrPowers
Copy link
Owner

The validate_presence_of_columns, validate_absence_of_columns, and validate_schema methods currently throw exceptions when they fail and return nothing otherwise.

It'd be nice to add a flag for these methods to return boolean values. That'd make it easier for folks to add schema safe append logic like this:

if quinn.validate_schema(df, bad_append_df.schema):
    bad_append_df.write.format("parquet").mode("append").save("tmp/parquet1")

Right now, quinn.validate_schema will return None, even if the schema match, and None is falsy in a boolean context.

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

No branches or pull requests

1 participant