Skip to content

Rhaarm validators#1

Open
rhaarm wants to merge 7 commits intorhaarm:Validatorsfrom
fastavro:rhaarm-Validators
Open

Rhaarm validators#1
rhaarm wants to merge 7 commits intorhaarm:Validatorsfrom
fastavro:rhaarm-Validators

Conversation

@rhaarm
Copy link
Owner

@rhaarm rhaarm commented May 21, 2018

Scott's changes on Validators feature.


def validate_many(records, schema):
return all([validate(record, schema) for record in records])
from fastavro.validate import validate, validate_many
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be updated as well for the name change of validate to validation

Copy link
Owner Author

@rhaarm rhaarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks good, except I have concern about the validate_many, it had a "stop_count" that was removed, which is beneficial when wanting to exit early or continue thru all records and only raise the invalid ones.



cpdef validate_many(records, schema, bint raise_errors=False, int stop_count=-1):
cpdef validate_many(records, schema, bint raise_errors=True):
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was stop_count removed? If validating many items and you wanted to exit on the first error, this would allow for early exit. Or if you wanted to capture all errors or just a few, it allows for that situation. Thoughts?

@scottbelden scottbelden deleted the rhaarm-Validators branch June 22, 2018 12:56
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.

2 participants