alamb opened a new pull request, #2024: URL: https://github.com/apache/arrow-rs/pull/2024
# Which issue does this PR close? Closes https://github.com/apache/arrow-rs/issues/1934 # Rationale for this change The lack of such an API caused me consternation in https://github.com/apache/arrow-datafusion/pull/2803 and https://github.com/influxdata/influxdb_iox/pull/5021 Basically I want to be able to change a field's nullability like ```rust let new_field = old_field.clone().with_nullable(false); ``` But instead I have to do something like ```rust // make a copy of the field, but allow it to be nullable Field::new(f.name(), f.data_type().clone(), true) .with_metadata(f.metadata().cloned()) ``` # What changes are included in this PR? Changes: 1. Add `Field::with_name` 1. Add `Field::with_data_type` 1. Add `Field::with_nullability` 2. Add examples (which also serve as tests) 3. Update additional documentation # Are there any user-facing changes? yes, new APIs and better docs -- 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]
