You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2019/11/28 17:36:00 UTC

[jira] [Commented] (AVRO-748) Python library does not include the implicit 'string' error type for messages

    [ https://issues.apache.org/jira/browse/AVRO-748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16984563#comment-16984563 ] 

ASF subversion and git services commented on AVRO-748:
------------------------------------------------------

Commit d28bf07d2da8dbddb561630ca69c0cee2d3f5b52 in avro's branch refs/heads/master from Michael A. Smith
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=d28bf07 ]

AVRO-748: Protocol Error Schema Implicit String (#717)

Account for the implicit string schema as one of the possible protocol error schema.

Similar to the changes in AVRO-2580, the protocol tests could hide errors when the overloaded exception handling catches the assertion error from the test itself. This corrects that.

> 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: Apache Avro
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 1.4.1
>         Environment: Ubuntu, Python 2.6.6
>            Reporter: Christopher Armstrong
>            Assignee: Michael A. Smith
>            Priority: Major
>
> Here's a trivial test case:
> {code:python}
> 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
> {code}
> 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 was sent by Atlassian Jira
(v8.3.4#803005)