Skip to content

Commit

Permalink
Fix logical type in union
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Perkins committed Sep 6, 2016
1 parent b3fbdc2 commit 897fb3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lang/ruby/lib/avro/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def self.validate(expected_schema, logical_datum, encoded = false)
datum = if encoded
logical_datum
else
expected_schema.type_adapter.encode(logical_datum)
expected_schema.type_adapter.encode(logical_datum) rescue nil
end

case expected_schema.type_sym
Expand Down
1 change: 1 addition & 0 deletions lang/ruby/test/test_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def test_recursive
def test_union
union_schema = <<EOS
["string",
{"type": "int", "logicalType": "date"},
"null",
"long",
{"type": "record",
Expand Down

0 comments on commit 897fb3a

Please sign in to comment.