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

   # Which issue does this PR close?
   
   - Closes #10493.
   
   # Rationale for this change
   
   `AvroObjectReader` converts every error from the underlying `ObjectStore` 
with `AvroError::General(e.to_string())`, and the header fetch loop wraps its 
error the same way, so the typed `object_store::Error` is destroyed: `source()` 
returns nothing and no downcast is possible. Callers implementing retry or 
error-classification logic cannot distinguish a permanent `NotFound` from a 
transient transport fault without string matching. `ParquetObjectReader` 
already preserves the source via `E: Into<ParquetError>` in the identical 
`spawn` helper plus `impl From<object_store::Error> for ParquetError`; this 
aligns arrow-avro with that pattern.
   
   # What changes are included in this PR?
   
   - `impl From<object_store::Error> for AvroError` (feature-gated on 
`object_store`), mapping to `AvroError::External(Box::new(e))`, which already 
reports its inner error via `source()` and maps through 
`ArrowError::from_external_error`.
   - The private `spawn` helper bound changes from `E: Error` to `E: 
Into<AvroError>`, mirroring `ParquetObjectReader::spawn`.
   - The header fetch loop propagates the reader error instead of reformatting 
it into `AvroError::General`.
   
   # Are these changes tested?
   
   Two new tests in `store.rs` assert that a read of a missing object surfaces 
an error whose `source()` chain downcasts to `object_store::Error::NotFound`, 
with and without a spawn runtime. Existing suites pass unchanged.
   
   # Are there any user-facing changes?
   
   Error `Display` text changes for store failures (`External: ...` instead of 
`Avro error: ...`). Variant selection within the `#[non_exhaustive]` 
`AvroError` is not a stability contract, so this is not considered a breaking 
API change.
   


-- 
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