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

   ### Rationale for this change
   
   `ArrowFormat::RecordBatch.new(values)` infers a schema from Ruby values. 
This adds the corresponding schema-aware constructor so callers can preserve 
intended Arrow types while building from Ruby rows or columns.
   
   ### What changes are included in this PR?
   
   * Add `ArrowFormat::RecordBatch.new(schema, values)` for row- and 
column-oriented Ruby values.
   * Build each column through its schema field type and preserve null values.
   * Cover type preservation, supported value forms, inconsistent column 
lengths, and invalid extra values.
   
   ### Are these changes tested?
   
   Yes. The `red-arrow-format` suite passes locally (690 tests, 693 
assertions), including the focused record-batch tests. The existing `red-arrow` 
record-batch suite also passes (21 tests, 21 assertions).
   
   ### Are there any user-facing changes?
   
   Yes.
   
   Closes #50571
   
   ### AI assistance
   
   AI assistance drafted the implementation and tests. The final scope was 
checked against the existing two-argument `Arrow::RecordBatch.new` contract and 
the one-argument `ArrowFormat::RecordBatch` API; the validation commands above 
were run locally.
   


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