Skip to content
69 changes: 0 additions & 69 deletions parquet/examples/async_read_parquet.rs

This file was deleted.

14 changes: 14 additions & 0 deletions parquet/src/arrow/arrow_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,20 @@ impl<T: ChunkReader + 'static> ParquetRecordBatchReaderBuilder<T> {
/// // Read data
/// let _batch = reader.next().unwrap().unwrap();
/// ```


/// # Example
/// ```rust
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded file path "data.parquet" will cause this example to fail when run via cargo test --doc. Examples in documentation should either use files that are known to exist (like those in the test data directory), or be marked with no_run to prevent execution during doc tests.

Suggested change
/// ```rust
/// ```rust,no_run

Copilot uses AI. Check for mistakes.
/// use parquet::arrow::arrow_reader::ArrowReaderBuilder;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an example for a different structure, right?

The doc example is on ParquetRecordBatchReaderBuilder but the example is using ArrowReaderBuilder 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @alamb, I’ve pushed an update converting the example into a doctest as suggested.
All checks pass locally (fmt, clippy, test).
Please let me know if you’d like any changes. Thanks!

/// # async fn example() -> parquet::errors::Result<()> {
/// let file = std::fs::File::open("data.parquet")?;
/// let builder = ArrowReaderBuilder::try_new(file)?;
/// let mut reader = builder.build()?;
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example creates a reader but never demonstrates using it to read data. Consider adding code that actually reads from the reader (e.g., iterating over batches) to provide a more complete demonstration of the API's functionality.

Suggested change
/// let mut reader = builder.build()?;
/// let mut reader = builder.build()?;
///
/// // Read all record batches from the reader
/// while let Some(batch) = reader.next().transpose()? {
/// println!("Read {} rows", batch.num_rows());
/// }

Copilot uses AI. Check for mistakes.
/// # Ok(())
/// # }
/// ```
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is marked as async (wrapped in async fn example()) but demonstrates synchronous file reading using std::fs::File. The deleted async_read_parquet.rs example actually demonstrated async reading using tokio::fs::File and ParquetRecordBatchStreamBuilder.

If the intent is to provide an async example for ArrowReaderBuilder::try_new, it should use the async API (ParquetRecordBatchStreamBuilder) instead of the synchronous API (ParquetRecordBatchReaderBuilder). Alternatively, if this is meant to be a synchronous example, the async fn example() wrapper should be removed and replaced with a regular function.

Copilot uses AI. Check for mistakes.

Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank lines before and after the example section. Standard Rust documentation style typically uses a single blank line between doc comment sections.

Copilot uses AI. Check for mistakes.

pub fn try_new(reader: T) -> Result<Self> {
Self::try_new_with_options(reader, Default::default())
}
Expand Down
Loading