Skip to content

ARROW-11313: [Rust] Fixed size_hint - #9258

Closed
jorgecarleitao wants to merge 1 commit into
apache:masterfrom
jorgecarleitao:fix_size_hint
Closed

ARROW-11313: [Rust] Fixed size_hint#9258
jorgecarleitao wants to merge 1 commit into
apache:masterfrom
jorgecarleitao:fix_size_hint

Conversation

@jorgecarleitao

Copy link
Copy Markdown
Member

size_hint should return the remaining items, not the total number of items.

@github-actions

Copy link
Copy Markdown

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #9258 (f76ceab) into master (1393188) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@## master #9258 +/- ##
=======================================
Coverage 81.61% 81.61% =======================================
Files 215 215 Lines 51867 51891 +24 =======================================
+ Hits 42329 42353 +24 
Misses 9538 9538 
Impacted FilesCoverage Δ
rust/arrow/src/array/iterator.rs93.45% <100.00%> (ø)
rust/parquet/src/arrow/schema.rs91.66% <100.00%> (+0.16%)⬆️
rust/arrow/src/array/transform/fixed_binary.rs84.21% <0.00%> (+5.26%)⬆️

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 1401359...ac029f6. Read the comment docs.

@alambalamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks consistent with https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.size_hint to me. 👍 @jorgecarleitao

I also found another implementation of size_hint but that seems to be doing the right thing: https://github.com/alamb/arrow/blob/master/rust/arrow/src/util/bit_chunk_iterator.rs#L156

@alambalamb closed this in 8e218e0Jan 19, 2021
@alamb

Copy link
Copy Markdown
Contributor

I merged this branch locally and ran the tests and everything looked good 👍

kszucs pushed a commit that referenced this pull request Jan 25, 2021
`size_hint` should return the remaining items, not the total number of items.
Closes#9258 from jorgecarleitao/fix_size_hint
Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@jorgecarleitao@codecov-io@alamb@paddyhoran