Skip to content
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

AVRO-1989: Ruby schema validation should use bytesize in error msg #451

Merged
merged 3 commits into from Feb 12, 2019

Conversation

Fokko
Copy link
Contributor

@Fokko Fokko commented Feb 10, 2019

Ruby schema validation for fixed types should use bytesize in error message.

Minor change based on https://issues.apache.org/jira/browse/AVRO-1989

Create a new PR based on the patch file: https://issues.apache.org/jira/secure/attachment/12849804/AVRO-1989.0.patch

@busbey
Copy link
Contributor

busbey commented Feb 10, 2019

Looks great. Thanks for updating the patch!

@tjwp
Copy link
Contributor

tjwp commented Feb 11, 2019

It would be good to have a test case that demonstrates the discrepancy. Something the following could be add to the test_fixed_size_string method here

def test_fixed_size_string

assert_failed_validation("at . expected fixed with size 3, got \"a\u2014b\" with size 5") do
  validate!(schema, "a\u2014b")
end
assert_failed_validation("at . expected fixed with size 3, got \"a\u2014b\" with size 5") do
  validate_simple!(schema, "a\u2014b")
end

Thanks for fixing this!

@Fokko
Copy link
Contributor Author

Fokko commented Feb 12, 2019

Thanks @tjwp I've added the test.

@tjwp
Copy link
Contributor

tjwp commented Feb 12, 2019

@Fokko There was an existing test_fixed_size_string method in that test file that contains a couple of assertions. I was suggesting that you add to that existing method. The change you made is overriding the existing test.

@Fokko
Copy link
Contributor Author

Fokko commented Feb 12, 2019

I see, thanks for pointing out @tjwp

@Fokko Fokko merged commit c62a8f9 into apache:master Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants