kojiromike commented on a change in pull request #1156:
URL: https://github.com/apache/avro/pull/1156#discussion_r609685645
##########
File path: lang/py/avro/errors.py
##########
@@ -44,10 +44,18 @@ class IgnoredLogicalType(AvroWarning):
class AvroTypeException(AvroException):
"""Raised when datum is not an example of schema."""
- def __init__(self, expected_schema, datum):
- pretty_expected = json.dumps(json.loads(str(expected_schema)),
indent=2)
- fail_msg = "The datum {} is not an example of the schema
{}".format(datum, pretty_expected)
- super(AvroTypeException, self).__init__(fail_msg)
+ def __init__(self, **kwargs):
+ if any(key not in kwargs.keys() for key in ['expected_schema', 'name',
'datum']):
Review comment:
Oops, this is not what I meant. For now, I think what you had before was
OK. We just need to recognize that these exception classes are not an external
or supported API for downstream users who want to extend them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]