Copilot commented on code in PR #50854: URL: https://github.com/apache/arrow/pull/50854#discussion_r3837883314
########## ruby/red-arrow-format/lib/arrow-format/array.rb: ########## @@ -852,7 +852,21 @@ def type end class FixedSizeBinaryArray < Array - def initialize(type, size, validity_buffer, values_buffer) + include BufferAlignable + + def initialize(type, *args) + unless type.is_a?(Type) + type = FixedSizeBinaryType.try_convert(type) || type + end + if args.size == 1 + args = build_data(args.first, type) + elsif args.size != 3 Review Comment: `FixedSizeBinaryArray.new(type, values)` assumes `type` is a `FixedSizeBinaryType` (has `byte_width`). If a caller passes another `ArrowFormat::Type` (or any non-convertible value), this will currently blow up later with `NoMethodError` inside `build_data`/`each_buffer`. It should fail fast with a clear `ArgumentError` after attempting `FixedSizeBinaryType.try_convert`. -- 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]
