Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Schema::with_metadata and Field::with_metadata #1092

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 22, 2021

Which issue does this PR close?

Re #1091

Rationale for this change

It is annoying to add metadata to Fields (and to a lesser degree Schemas)

What changes are included in this PR?

  1. Add Schema::with_metadata and Field::with_metadata
  2. Update code to use with_metadata which I think is much nicer

Are there any user-facing changes?

New functions

@github-actions github-actions bot added the arrow Changes to the arrow crate label Dec 22, 2021
]);
let schema =
Schema::new(vec![
Field::new("bools-with-metadata-map", DataType::Boolean, true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes I think show the improved API: no more mut during construction of a Schema

@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2021

Codecov Report

Merging #1092 (dfbeb22) into master (e8cc39e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1092   +/-   ##
=======================================
  Coverage   82.31%   82.31%           
=======================================
  Files         168      168           
  Lines       49383    49380    -3     
=======================================
  Hits        40649    40649           
+ Misses       8734     8731    -3     
Impacted Files Coverage Δ
arrow/src/datatypes/field.rs 54.10% <100.00%> (+0.42%) ⬆️
arrow/src/datatypes/mod.rs 100.00% <100.00%> (ø)
arrow/src/datatypes/schema.rs 73.45% <100.00%> (+0.50%) ⬆️
arrow/src/ipc/convert.rs 94.38% <100.00%> (+0.18%) ⬆️
arrow/src/util/integration_util.rs 68.53% <100.00%> (-0.13%) ⬇️
arrow/src/array/transform/mod.rs 84.86% <0.00%> (+0.13%) ⬆️
parquet_derive/src/parquet_field.rs 66.21% <0.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8cc39e...dfbeb22. Read the comment docs.

@alamb alamb requested review from houqp and jimexist January 1, 2022 12:58
@alamb
Copy link
Contributor Author

alamb commented Jan 5, 2022

Since there are no objections or comments, merging this one in

@alamb alamb merged commit 3c12ebe into master Jan 5, 2022
@alamb alamb deleted the alamb/metadata_ease branch January 20, 2022 11:32
@alamb
Copy link
Contributor Author

alamb commented Jul 30, 2022

Related to #1091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants