avro 1.12.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 494daaa5f42901a0ae52f6fe0b723c3c0f0ec2d951e425c76cdc3998c7f7d2af
4
- data.tar.gz: 04d5c0c5eba948dfde59ea0c5d328de0926df053e9d9d04a8dd61bc6f1982a1f
3
+ metadata.gz: 46d81e90862e8e8e5a31ae68f1d8f71a9b23f4973c9e2a640adb8cabeecdc215
4
+ data.tar.gz: 6cc227d9ec1d04cc0b0bfb8419a761cc97f50ffdc74d764e770a14a22d284dca
5
5
  SHA512:
6
- metadata.gz: 2f52c72d63ce36d92ac83625b951422be2aea73889f8de13e4d40cc87af8c56a717484d6d55f71979d2acd1680f967c4d65b908e9f68bc25f850aa0ebac204db
7
- data.tar.gz: a839620ed610140111c47de1ad050f75c35ed036221165cb3b1fae30556b8e41be86db073fd59fe788f4b346ed41efbff21c81cc4ad2a8caa136a40b9a04cec7
6
+ metadata.gz: c14cbff47951d9a225d14c5dc8eb0d73636c55fc0a56bd0d39832353438b9dc99f2208eedd0357efca09af282ddd4fe7d6eabe176d1f35706a67ff69e7e177be
7
+ data.tar.gz: 20887f5e463266809a5c7a5fbe753b292ee1d47129c6288afcdbd5a7b1c4c79167fd57bfe9238fcc1e1689182c6cab97ae4b59bca34cda2e8746df0722e968d4
data/lib/avro/VERSION.txt CHANGED
@@ -1 +1 @@
1
- 1.12.0
1
+ 1.12.1
@@ -121,19 +121,19 @@ module Avro
121
121
 
122
122
  case expected_schema.type_sym
123
123
  when :null
124
- fail TypeMismatchError unless datum.nil?
124
+ return type_mismatch_error(expected_schema, datum, path, result) unless datum.nil?
125
125
  when :boolean
126
- fail TypeMismatchError unless BOOLEAN_VALUES.include?(datum)
126
+ return type_mismatch_error(expected_schema, datum, path, result) unless BOOLEAN_VALUES.include?(datum)
127
127
  when :string, :bytes
128
- fail TypeMismatchError unless datum.is_a?(String)
128
+ return type_mismatch_error(expected_schema, datum, path, result) unless datum.is_a?(String)
129
129
  when :int
130
- fail TypeMismatchError unless datum.is_a?(Integer)
130
+ return type_mismatch_error(expected_schema, datum, path, result) unless datum.is_a?(Integer)
131
131
  result.add_error(path, "out of bound value #{datum}") unless INT_RANGE.cover?(datum)
132
132
  when :long
133
- fail TypeMismatchError unless datum.is_a?(Integer)
133
+ return type_mismatch_error(expected_schema, datum, path, result) unless datum.is_a?(Integer)
134
134
  result.add_error(path, "out of bound value #{datum}") unless LONG_RANGE.cover?(datum)
135
135
  when :float, :double
136
- fail TypeMismatchError unless datum.is_a?(Float) || datum.is_a?(Integer) || datum.is_a?(BigDecimal)
136
+ return type_mismatch_error(expected_schema, datum, path, result) unless datum.is_a?(Float) || datum.is_a?(Integer) || datum.is_a?(BigDecimal)
137
137
  when :fixed
138
138
  if datum.is_a? String
139
139
  result.add_error(path, fixed_string_message(expected_schema.size, datum)) unless datum.bytesize == expected_schema.size
@@ -143,7 +143,9 @@ module Avro
143
143
  when :enum
144
144
  result.add_error(path, enum_message(expected_schema.symbols, datum)) unless expected_schema.symbols.include?(datum)
145
145
  end
146
- rescue TypeMismatchError
146
+ end
147
+
148
+ def type_mismatch_error(expected_schema, datum, path, result)
147
149
  result.add_error(path, "expected type #{expected_schema.type_sym}, got #{actual_value_message(datum)}")
148
150
  end
149
151
 
@@ -338,7 +338,7 @@ class TestLogicalTypes < Test::Unit::TestCase
338
338
  end
339
339
 
340
340
  assert_equal 5, report.total_allocated
341
- assert_operator 1, :>=, report.total_retained
341
+ assert_operator 2, :>=, report.total_retained
342
342
  end
343
343
  end
344
344
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apache Software Foundation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-26 00:00:00.000000000 Z
11
+ date: 2025-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -72,7 +72,7 @@ metadata:
72
72
  homepage_uri: https://avro.apache.org/
73
73
  bug_tracker_uri: https://issues.apache.org/jira/browse/AVRO
74
74
  source_code_uri: https://github.com/apache/avro
75
- documentation_uri: https://avro.apache.org/docs/1.12.0/
75
+ documentation_uri: https://avro.apache.org/docs/1.12.1/
76
76
  rubygems_mfa_required: 'true'
77
77
  post_install_message:
78
78
  rdoc_options: