-
Notifications
You must be signed in to change notification settings - Fork 128
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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)
singer/catalog.py
Outdated
|
||
CATALOG_SCHEMA = {'type': 'object', | ||
'required': ['streams'], | ||
'properties': { |
There was a problem hiding this comment.
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?
@nick-mccoy tests are failing. It's a pretty trivial issue, just pylint complaining about whitespace. |
…is set to UTC for time_extracted
…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
changing strftime format string
Added write_catalog function
Added write_catalog function