kou commented on code in PR #48584:
URL: https://github.com/apache/arrow/pull/48584#discussion_r2634343445
##########
ruby/red-arrow/lib/arrow/array-builder.rb:
##########
@@ -155,12 +155,14 @@ def detect_builder_info(value, builder_info)
sub_builder_info = detect_builder_info(sub_value, sub_builder_info)
break if sub_builder_info and sub_builder_info[:detected]
end
- if sub_builder_info and sub_builder_info[:detected]
- sub_value_data_type = sub_builder_info[:builder].value_data_type
+ if sub_builder_info
+ sub_builder = sub_builder_info[:builder]
+ return builder_info unless sub_builder
+ sub_value_data_type = sub_builder.value_data_type
field = Field.new("item", sub_value_data_type)
{
builder: ListArrayBuilder.new(ListDataType.new(field)),
- detected: true,
+ detected: !!sub_builder_info[:detected],
Review Comment:
Is this `!!` for converting `nil` to `false`?
If so, we don't need it because `nil` is also a false value.
--
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]