`BatchCoalescer::is_empty` rustdoc says the opposite of what it returns
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- documentation
Research direction
The doc comment is on BatchCoalescer::is_empty in arrow-select/src/coalesce.rs, around lines 616-619. Read the method body, which returns buffered_rows == 0 && completed.is_empty(), and rewrite the first doc line to describe that condition. Done when the rustdoc matches the code and cargo test --doc -p arrow-select passes.
Written by the indexing model from the issue text.
Description
Describe the bug
The rustdoc of BatchCoalescer::is_empty says "Returns true if there is any buffered data". It returns self.buffered_rows == 0 && self.completed.is_empty(), which is true when there is no buffered data and no completed batch.
To Reproduce
use std::sync::Arc;
use arrow_array::{Int32Array, RecordBatch};
use arrow_schema::{DataType, Field, Schema};
use arrow_select::coalesce::BatchCoalescer;
fn main() {
let schema = Arc::new(Schema::new(vec![Field::new("a", DataType::Int32, false)]));
let mut co = BatchCoalescer::new(schema.clone(), 10);
println!("{}", co.is_empty()); // true, with nothing buffered
let batch = RecordBatch::try_new(schema, vec![Arc::new(Int32Array::from(vec![1, 2]))]).unwrap();
co.push_batch(batch).unwrap();
println!("{}", co.is_empty()); // false, with 2 rows buffered
}
Expected behavior
A rustdoc that matches the behavior, such as "Returns true if there are no buffered rows and no completed batches".
Additional context
Found with property-based tests that build arrays in every physical layout the Arrow format allows, on main at 72887ed9. The rustdoc is unchanged on main at dd240116.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 311
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow-rs
-
ipc: slicing buffer should not panic on invalid slicePossibly taken @wleeaf claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/arrow-rs#11857 · 1 comment ·
Maintainers usually reply within 1 day
-
ipc: slicing union buffer should validate lengthPossibly taken @wleeaf claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
`interleave_record_batch` panics on no batches and fails on batches with no columnsPossibly taken @princejain756 claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
parquet: panic (index out of bounds) reading FIXED_LEN_BYTE_ARRAY dictionary page with out-of-range indexPossibly taken @efegokdemir claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
manuscript-lang/manuscript#1364 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
equinor/septic-config-generator#504 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
GiganticMinecraft/seichi-portal-backend#1633 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
fable-compiler/Fable#5157 ·
Maintainers usually reply within 1 day