rambleraptor opened a new pull request, #8687:
URL: https://github.com/apache/arrow-rs/pull/8687

   # Which issue does this PR close?
   
   Part of #7806 
   
   # Rationale for this change
   
   The `byte_range()` method on `ColumnChunkMetaData` previously panicked if 
the column start or length were negative. This is undesirable in a library, as 
it can lead to unrecoverable errors in consumer applications.
   
   This change modifies `byte_range()` to return a `Result<(u64, u64)>` 
instead, allowing callers to handle invalid byte ranges gracefully.
   
   # What changes are included in this PR?
   
   - The `byte_range()` method in `parquet/src/file/metadata/mod.rs` now 
returns a `Result`.
   - Call sites of `byte_range()` have been updated to handle the `Result` 
using the `?` operator or `unwrap()` in tests. This affects:
     - `parquet/examples/read_with_rowgroup.rs`
     - `parquet/src/arrow/async_reader/mod.rs`
     - `parquet/src/file/serialized_reader.rs`
   
   # Are these changes tested?
   
   The changes are covered by existing tests. The modifications in the test 
files (`parquet/src/arrow/async_reader/mod.rs`) now use `unwrap()` on the 
`byte_range()` call, which maintains the existing test behavior of panicking on 
error.
   
   # Are there any user-facing changes?
   
   Yes, the signature of 
`parquet::file::metadata::ColumnChunkMetaData::byte_range()` has changed from 
`-> (u64, u64)` to `-> Result<(u64, u64)>`. This is a breaking change for users 
who call this method directly.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to