This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 876585c1cd Fix doc test in avro-arrow (#8020)
876585c1cd is described below
commit 876585c1cd986dbaee0c26d52b55a4186a2f68c8
Author: Andrew Lamb <[email protected]>
AuthorDate: Tue Jul 29 14:22:04 2025 -0400
Fix doc test in avro-arrow (#8020)
# Which issue does this PR close?
- part of https://github.com/apache/arrow-rs/issues/7395
- Closes https://github.com/apache/arrow-rs/issues/8018
# Rationale for this change
Fix a bug I found while testing the RC
# What changes are included in this PR?
Check the ARROW_TESTING directory first before looking at the local path
# Are these changes tested?
Yes, by CI and I tested it manually
# Are there any user-facing changes?
No
---
arrow-avro/src/reader/mod.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arrow-avro/src/reader/mod.rs b/arrow-avro/src/reader/mod.rs
index 02d3f49aa1..470b0f2788 100644
--- a/arrow-avro/src/reader/mod.rs
+++ b/arrow-avro/src/reader/mod.rs
@@ -34,8 +34,12 @@
//! # use std::fs::File;
//! # use std::io::BufReader;
//! # use arrow_avro::reader::ReaderBuilder;
-//!
-//! let file = File::open("../testing/data/avro/alltypes_plain.avro").unwrap();
+//! # let path = "avro/alltypes_plain.avro";
+//! # let path = match std::env::var("ARROW_TEST_DATA") {
+//! # Ok(dir) => format!("{dir}/{path}"),
+//! # Err(_) => format!("../testing/data/{path}")
+//! # };
+//! let file = File::open(path).unwrap();
//! let mut avro = ReaderBuilder::new().build(BufReader::new(file)).unwrap();
//! let batch = avro.next().unwrap();
//! ```