hypsakata opened a new pull request, #48584:
URL: https://github.com/apache/arrow/pull/48584

   ### Rationale for this change 
   
   When building an `Arrow::Table` from a Ruby Hash passed to 
`Arrow::Table.new`, nested `Integer` arrays are incorrectly inferred as 
`string` (utf8) if all values are non-negative. This behavior is unexpected; 
nested integer arrays should be consistently represented as a list type (e.g., 
`list<item: uint*>` or `list<item: int*>`) rather than falling back to UTF-8 
strings. 
   
   ### What changes are included in this PR? 
   
   This PR modifies the logic in `detect_builder_info()`, specifically the 
`when ::Array` block, to correctly identify nested non-negative integer arrays 
as list arrays. 
   
   The change ensures that if `sub_builder_info` contains a valid `:builder`, 
it will be used even if `sub_builder_info` does not yet indicate that the type 
has been "detected."
   
   ### Are these changes tested?
   
   Yes. (`ruby ruby/red-arrow/test/run-test.rb`)
   
   ### Are there any user-facing changes?
   
   Yes.
   
   GitHub Issue: Closes #48478 


-- 
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