From 70955334c7150f096a3c9dc2c3267fb46cf02048 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 31 Jul 2026 09:08:00 -0400 Subject: [PATCH] Improve documentation for Avro Reader --- arrow-avro/src/lib.rs | 6 +++++- arrow-avro/src/reader/async_reader/async_file_reader.rs | 4 +++- arrow-avro/src/reader/async_reader/store.rs | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arrow-avro/src/lib.rs b/arrow-avro/src/lib.rs index 4314ef96b2a4..634f9d7389d2 100644 --- a/arrow-avro/src/lib.rs +++ b/arrow-avro/src/lib.rs @@ -131,11 +131,15 @@ //! [`AsyncAvroFileReader`] implements `Stream>`, //! allowing efficient async streaming of record batches. Any [`AsyncFileReader`] //! can be used as the source; there is a built-in implementation for types -//! implementing `AsyncRead + AsyncSeek` (such as `tokio::fs::File`), and object +//! implementing [`AsyncRead`] + [`AsyncSeek`] (such as [`tokio::fs::File`]), and object //! storage services such as S3 can be integrated by implementing //! [`AsyncFileReader`] on top of a client such as the [object_store] crate //! (see the example on the trait documentation). //! +//! [`AsyncRead`]: tokio::io::AsyncRead +//! [`AsyncSeek`]: tokio::io::AsyncSeek +//! [`tokio::fs::File`]: https://docs.rs/tokio/latest/tokio/fs/struct.File.html +//! //! ```ignore //! use arrow_avro::reader::AsyncAvroFileReader; //! use futures::TryStreamExt; diff --git a/arrow-avro/src/reader/async_reader/async_file_reader.rs b/arrow-avro/src/reader/async_reader/async_file_reader.rs index 8e69d4611c4e..e7f567bcd8cd 100644 --- a/arrow-avro/src/reader/async_reader/async_file_reader.rs +++ b/arrow-avro/src/reader/async_reader/async_file_reader.rs @@ -30,12 +30,14 @@ use tokio::io::{AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt}; /// 1. There is a default implementation for types that implement [`AsyncRead`] /// and [`AsyncSeek`], for example [`tokio::fs::File`]. /// -/// 2. Implementations for remote storage, such as the `object_store` crate, +/// 2. Implementations for remote storage, such as the [`object_store`] crate, /// can implement this interface directly, typically by pairing a store /// handle with an object path and delegating [`Self::get_bytes`] and /// [`Self::get_byte_ranges`] to ranged reads. [`super::SpawnedReader`] can /// wrap such a reader to perform its I/O on a dedicated tokio runtime. /// +/// [`object_store`]: https://crates.io/crates/object_store +/// /// # Example: implementing `AsyncFileReader` for the `object_store` crate /// /// ```no_run diff --git a/arrow-avro/src/reader/async_reader/store.rs b/arrow-avro/src/reader/async_reader/store.rs index 9b2c126645dc..56b2f60aa2a7 100644 --- a/arrow-avro/src/reader/async_reader/store.rs +++ b/arrow-avro/src/reader/async_reader/store.rs @@ -31,7 +31,7 @@ use tokio::runtime::Handle; /// An implementation of an AsyncFileReader using the [`ObjectStore`] API. #[deprecated( since = "59.2.0", - note = "Implement `AsyncFileReader` directly instead; see the example on the `AsyncFileReader` trait documentation and `arrow-avro/examples/object_store.rs`. Use `SpawnedReader` to perform I/O on a dedicated runtime." + note = "Implement `AsyncFileReader` directly instead; see the example on the `AsyncFileReader` trait documentation and `arrow-avro/examples/object_store.rs`. Use `SpawnedReader` to perform I/O on a dedicated runtime. See also https://github.com/apache/arrow-rs/issues/10308" )] #[derive(Clone, Debug)] pub struct AvroObjectReader { @@ -61,7 +61,7 @@ impl AvroObjectReader { /// [here]: https://www.influxdata.com/blog/using-rustlangs-async-tokio-runtime-for-cpu-bound-tasks/ #[deprecated( since = "59.2.0", - note = "Wrap the reader in a `SpawnedReader` instead, e.g. `SpawnedReader::new(reader, handle)`" + note = "Wrap the reader in a `SpawnedReader` instead, e.g. `SpawnedReader::new(reader, handle)`. See also https://github.com/apache/arrow-rs/issues/10308" )] pub fn with_runtime(self, handle: Handle) -> Self { Self {