[
https://issues.apache.org/jira/browse/AVRO-748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12987825#action_12987825
]
Christopher Armstrong commented on AVRO-748:
--------------------------------------------
Actually, there's a similar error in the code which reads errors, so I would
say that the best place to fix this is in the parser. I made it so
protocol.Message.__init__ sets the 'errors' property to the result of a call to
self._parse_errors with an empty list, and that seemed to work for me.
Sorry, I can't provide a patch.
> Python library does not include the implicit 'string' error type for messages
> -----------------------------------------------------------------------------
>
> Key: AVRO-748
> URL: https://issues.apache.org/jira/browse/AVRO-748
> Project: Avro
> Issue Type: Bug
> Components: python
> Affects Versions: 1.4.1
> Environment: Ubuntu, Python 2.6.6
> Reporter: Christopher Armstrong
>
> Here's a trivial test case:
> schema = """
> {
> "namespace": "test",
> "protocol": "test",
> "types": [],
> "messages": {"test_method": {
> "request": [],
> "response": "string"}}
> }
> """
> from avro.protocol import parse
> protocol = parse(schema)
> assert protocol.messages['test_method'].errors is not None
> This may be a bit white-box; the problem actually manifests in
> avro.ipc.Responder.respond (line 338), when making a call to write_error with
> the "writers_schema" being "local_message.errors". local_message.errors is
> None, and it blows up while validating the schema.
> This only seems to happen when there is *no* errors field in the message; if
> an errors field is provided, it still doesn't explicitly include "string" in
> the "errors" field, but it does seem to allow the error message to be passed
> back. So maybe this is an error in the protocol parser, or maybe it's an
> error in the code that actually tries to write the error response.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.