tz70s opened a new pull request, #11734: URL: https://github.com/apache/arrow-rs/pull/11734
# Which issue does this PR close? None. This is a small, self-contained fix, so no issue was filed. # Rationale for this change `record_batch!` expands to `arrow_schema::*` paths, which resolve in the caller's crate. Users who depend only on the `arrow` umbrella crate and call `arrow::array::record_batch!` get: ``` error[E0433]: cannot find module or crate `arrow_schema` in this scope ``` and have to add `arrow_schema` as a direct dependency to use the macro, or work around it with `use arrow::datatypes as arrow_schema;`. # What changes are included in this PR? `record_batch!` now builds the batch with `RecordBatch::try_from_iter_with_nullable`, using `create_array!` for the columns. As a side effect, types supported by `create_array!` that are not unit `DataType` variants (e.g. `TimestampSecond`) now work in `record_batch!`; previously they failed to compile. # Are these changes tested? Added unit tests for the macro. The missing-dependency case itself can't be reproduced in-tree since workspace crates already depend on `arrow_schema`; I verified it with a standalone crate depending only on `arrow`. # Are there any significant user-facing changes? No breaking changes. `record_batch!` now works with only the `arrow` dependency and also accepts the additional types mentioned above. --- This change was written with help from an AI assistant (Claude Code). I have reviewed and understand all of it. -- 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]
