tjwp commented on code in PR #2277:
URL: https://github.com/apache/avro/pull/2277#discussion_r1231442323


##########
lang/ruby/lib/avro/io.rb:
##########
@@ -423,11 +423,13 @@ def read_default_value(field_schema, default_value)
             field_val = read_default_value(field.type, json_val)
             read_record[field.name] = field_val
           end
-          return read_record
+          read_record
         else
           fail_msg = "Unknown type: #{field_schema.type}"
           raise AvroError, fail_msg
         end
+
+        field_schema.logical_type ? field_schema.type_adapter.decode(datum) : 
datum

Review Comment:
   I think we should avoid the ternary and always call `type_adapter.decode` 
for consistency with `read_data` 
https://github.com/apache/avro/blob/164dd730fcd9c343687e77a995ef609075c22ebf/lang/ruby/lib/avro/io.rb#L293
   
   ```suggestion
           field_schema.type_adapter.decode(datum)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to