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

validating schema in discovery mode #56

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

nick-mccoy
Copy link
Contributor

Added write_catalog function

Copy link
Contributor

@mdelaurentis mdelaurentis left a comment

Choose a reason for hiding this comment

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

Code looks good. Please see the one comment on additionalProperties.

What does it look like to the user when the tap provides a schema that fails validation? I would suggest adding a test for that case. You can use the assertRaisesRegex context manager, as documented here: https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaisesRegex.

Like:

with self.assertRaisesRegex(ValueError, "Some pattern you want the message to match):
    do(some_stuff)


CATALOG_SCHEMA = {'type': 'object',
'required': ['streams'],
'properties': {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might want to add "additionalProperties": false here and in the other nested object in this schema. If you don't the validator will allow objects with other properties. I guess it depends on how strict we want to be in this validation. @cmerrick what are your thoughts on that?

@mdelaurentis
Copy link
Contributor

@nick-mccoy tests are failing. It's a pretty trivial issue, just pylint complaining about whitespace.

Nick McCoy and others added 22 commits November 27, 2017 14:56
…perties

Adding time_extracted and bookmark_properties
…y-in-schema-message-init

move bookmark property handling from write_schema into SchemaMessage __init__
Changing SchemaMessage so that bookmark_properties is always a list
Add stream_alias to Catalog.to_dict
Add metadata assignment to Catalog.from_dict
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.

None yet

4 participants