Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Added Array::with_validity #399

Merged
merged 3 commits into from
Sep 13, 2021

Conversation

ritchie46
Copy link
Collaborator

This adds with_validity(&self, validity: Option<Bitmap>) -> Result<Box<dyn Array>> to the dyn Array trait. This allows creating a new array with the new validity without downcasting.

@codecov
Copy link

codecov bot commented Sep 12, 2021

Codecov Report

Merging #399 (493ddd4) into main (f326fed) will decrease coverage by 0.23%.
The diff coverage is 13.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
- Coverage   81.13%   80.89%   -0.24%     
==========================================
  Files         347      347              
  Lines       21991    22086      +95     
==========================================
+ Hits        17842    17867      +25     
- Misses       4149     4219      +70     
Impacted Files Coverage Δ
src/array/binary/mod.rs 73.91% <0.00%> (-9.70%) ⬇️
src/array/boolean/mod.rs 63.41% <0.00%> (-15.38%) ⬇️
src/array/dictionary/mod.rs 58.82% <0.00%> (-10.95%) ⬇️
src/array/fixed_size_binary/mod.rs 41.79% <0.00%> (-5.67%) ⬇️
src/array/fixed_size_list/mod.rs 47.45% <0.00%> (-7.45%) ⬇️
src/array/list/mod.rs 71.79% <0.00%> (-8.21%) ⬇️
src/array/mod.rs 58.97% <ø> (ø)
src/array/null.rs 38.46% <0.00%> (-3.21%) ⬇️
src/array/struct_.rs 37.34% <0.00%> (-3.99%) ⬇️
src/array/union/mod.rs 81.00% <0.00%> (-1.66%) ⬇️
... and 12 more

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 f326fed...493ddd4. Read the comment docs.

Copy link
Owner

@jorgecarleitao jorgecarleitao left a comment

Choose a reason for hiding this comment

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

Very close; imo we should keep them equal to keep the invariant useful for people that iterate over one or the other without fear of going out of bounds.

src/array/binary/mod.rs Outdated Show resolved Hide resolved
@jorgecarleitao jorgecarleitao merged commit 227ab3b into jorgecarleitao:main Sep 13, 2021
@jorgecarleitao
Copy link
Owner

Thanks a lot, @ritchie46 !

@jorgecarleitao jorgecarleitao added feature A new feature enhancement An improvement to an existing feature and removed feature A new feature labels Sep 13, 2021
@jorgecarleitao jorgecarleitao changed the title Add Array::with_validity Add Array::with_validity Sep 14, 2021
@jorgecarleitao jorgecarleitao changed the title Add Array::with_validity Added Array::with_validity Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants