You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Suraj Acharya (JIRA)" <ji...@apache.org> on 2017/02/10 03:04:41 UTC

[jira] [Comment Edited] (AVRO-1989) Ruby schema validation for fixed types should use bytesize in error message

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

Suraj Acharya edited comment on AVRO-1989 at 2/10/17 3:03 AM:
--------------------------------------------------------------

The patch looks great to me.
However, from the looks of it, the tests are failing on an unrelated note. Is it possible for you to look at those too? It is highly possible it is my environment but your opinion is appreciated

{code}
Fri Feb 10 00:38:33 UTC 2017
cd /testptch/unknown/lang/ruby
./build.sh test
ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String
{code}


was (Author: sacharya):
The patch looks great to me.
However, from the looks of it, the tests are failing on an unrelated note. Is it possible for you to look at those too? It is highly possible it is my environment but your opinion is appreciated

> Ruby schema validation for fixed types should use bytesize in error message
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1989
>                 URL: https://issues.apache.org/jira/browse/AVRO-1989
>             Project: Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.9.0
>            Reporter: Sean Busbey
>            Assignee: Sean Busbey
>            Priority: Minor
>             Fix For: 1.9.0
>
>         Attachments: AVRO-1989.0.patch
>
>
> From AVRO-1886:
> I'd like to get one thing improved, but it's fine as a follow-on.
> {code}
>  +       when :fixed
>  +          if datum.is_a? String
>  +            message = "expected fixed with size #{expected_schema.size}, got \"#{datum}\" with size #{datum.size}"
>  +            result.add_error(path, message) unless datum.bytesize == expected_schema.size
>  +          else
>  +            result.add_error(path, "expected fixed with size #{expected_schema.size}, got #{actual_value_message(datum)}")
>  +          end
> {code}
> the message here should use datum.bytesize instead of datum.size.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)