alamb opened a new pull request #822: URL: https://github.com/apache/arrow-rs/pull/822
# Which issue does this PR close? Part of https://github.com/apache/arrow-rs/issues/817 # Rationale for this change This PR is a step towards making arrow-rs Rust `safe` and resolving open RUSTSEC issues. * `ArrayData::new()` is fundamentally `unsafe` (in the Rust sense) as it relies on the user to pass in valid data or else allows undefined behavior. The API is easy to misuse and should be marked as `unsafe` to reflect this. See #817 for more background. Builds on @jhorstmann 's work in https://github.com/apache/arrow-rs/pull/813 # What changes are included in this PR? - [ ] Removes `ArrayData::new()` - [ ] Creates `unsafe ArrayData::new_unchecked()` and `ArrayData::try_new()` - [ ] Makes `ArrayDataBuilder::build()` fallible - [ ] Adds `unsafe ArrayDataBuilder::build_unchecked()` Note: * This PR contains only the proposed API changes. It does not contain any validation. I plan to add the extra validation as a follow on PR (I have it partly implemented in https://github.com/apache/arrow-rs/pull/810) ** Splitting the changes into several PRs I think will help with reviews ** I would like to ensure the API changes are included it arrow-rs 6.0 (planning to make a release candidate in the next week or so). We can then add additional validation in 6.1, 6.2, etc as they will be non breaking API changes. * Other than the API changes noted above, the PR is entirely mechanical to use the new API # Are there any user-facing changes? Yes -- the APIs for creating ArrayData are different. This should not affect any users who create Arrays directly, only those using the lower level APIs. -- 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]
