Skip to content

fix(arrow-avro): preserve object_store error source in the async reader - #10496

Open
ranflarion wants to merge 1 commit into
apache:mainfrom
ranflarion:avro-object-store-error-source
Open

fix(arrow-avro): preserve object_store error source in the async reader#10496
ranflarion wants to merge 1 commit into
apache:mainfrom
ranflarion:avro-object-store-error-source

Conversation

@ranflarion

Copy link
Copy Markdown

Which issue does this PR close?

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.

@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-avro arrow-avro crate labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate arrow-avro arrow-avro crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arrow-avro: object_store error type is lost in the async reader (stringified into AvroError::General)

1 participant