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

feat: add support for the null data type to v2 #2685

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

westonpace
Copy link
Contributor

Need a tiny bit of extra logic because an array with the null data type will report 0 as its null count.

@github-actions github-actions bot added the enhancement New feature or request label Aug 3, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.

Project coverage is 79.57%. Comparing base (89ad237) to head (39133ac).
Report is 1 commits behind head on main.

Files Patch % Lines
rust/lance-datagen/src/generator.rs 82.35% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2685      +/-   ##
==========================================
+ Coverage   79.56%   79.57%   +0.01%     
==========================================
  Files         226      226              
  Lines       66424    66544     +120     
  Branches    66424    66544     +120     
==========================================
+ Hits        52847    52954     +107     
+ Misses      10476    10472       -4     
- Partials     3101     3118      +17     
Flag Coverage Δ
unittests 79.57% <90.32%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +198 to +204
if matches!(arr.data_type(), DataType::Null) {
// Arrays with the null datatype report 0 as the null count so we
// need special logic to get the correct null count
(arr.len() as u32, arr.len() as u32)
} else {
(arr.null_count() as u32, arr.len() as u32)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you are interested, I think all the exceptions on null count are described here: https://docs.rs/arrow/latest/arrow/array/trait.Array.html#method.logical_nulls

@westonpace westonpace merged commit eb7b790 into lancedb:main Aug 5, 2024
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants