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

Changed validity from &Option<Bitmap> to Option<&Bitmap>. #431

Merged
merged 1 commit into from
Sep 25, 2021

Conversation

jorgecarleitao
Copy link
Owner

@jorgecarleitao jorgecarleitao commented Sep 20, 2021

Changed the signature of Array::validity() and MutableArray::validity(). IMO it makes the API a bit easier to use and aligned with other methods in std.

To migrate:

  • Change validity().as_ref().unwrap() to validity().unwrap()
  • Change validity().as_ref().map(...) to validity().map(...)
  • Change validity().clone() to validity().cloned()
  • Change &Option<Bitmap> to Option<&Bitmap>
  • Change assert_eq!(validity, &None) to assert_eq!(validity, None)
  • Change assert_eq!(validity, &Some(Bitmap(...)) to assert_eq!(validity, Some(&Bitmap(...)))

@codecov
Copy link

codecov bot commented Sep 20, 2021

Codecov Report

Merging #431 (c45aa8c) into main (688e979) will increase coverage by 0.00%.
The diff coverage is 86.88%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #431   +/-   ##
=======================================
  Coverage   80.77%   80.78%           
=======================================
  Files         372      372           
  Lines       22637    22637           
=======================================
+ Hits        18286    18288    +2     
+ Misses       4351     4349    -2     
Impacted Files Coverage Δ
src/array/binary/mutable.rs 65.40% <0.00%> (ø)
src/array/dictionary/mutable.rs 82.14% <0.00%> (ø)
src/array/fixed_size_list/mutable.rs 40.38% <0.00%> (ø)
src/array/list/mutable.rs 75.86% <0.00%> (ø)
src/array/mod.rs 58.97% <ø> (ø)
src/array/utf8/mutable.rs 89.91% <0.00%> (ø)
src/compute/nullif.rs 0.00% <0.00%> (ø)
src/compute/sort/common.rs 92.85% <ø> (ø)
src/io/parquet/write/binary/basic.rs 85.13% <ø> (ø)
src/io/parquet/write/mod.rs 51.28% <0.00%> (ø)
... and 49 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 688e979...c45aa8c. Read the comment docs.

@ritchie46
Copy link
Collaborator

IMO this makes sense. And is a patter you seem more often in std.

@jorgecarleitao
Copy link
Owner Author

cc @sundy-li @houqp since this affects your work on databend and datafusion, respectively.

@houqp
Copy link
Collaborator

houqp commented Sep 20, 2021

LGTM, nice improvements.

@jorgecarleitao jorgecarleitao changed the title Changed &Option<Bitmap> to Option<&Bitmap>. Changed validity from &Option<Bitmap> to Option<&Bitmap>. Sep 22, 2021
@sundy-li
Copy link
Collaborator

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants