Skip to content

Rhaarm validators#1

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

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

Conversation

@rhaarm

@rhaarm rhaarm commented May 21, 2018

Copy link
Copy Markdown
Owner

Scott's changes on Validators feature.

Comment thread benchmark/benchmark.py Outdated

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

Copy link
Copy Markdown
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

@rhaarm rhaarm left a comment

Copy link
Copy Markdown
Owner Author

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.

Comment thread fastavro/_validation.pyx


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

Copy link
Copy Markdown
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