From 06478213a56f38defe7df368f26c15912911ef31 Mon Sep 17 00:00:00 2001 From: Billy Snikkers Date: Fri, 3 Jul 2026 22:33:13 +1000 Subject: [PATCH] fix: strip prefix from get_opts result in MaybePrefixedStore MaybePrefixedStore::get_opts returned an ObjectMeta whose location still carried the store prefix, unlike list/list_with_delimiter which strip it. Because head delegates to get_opts, and the buffered reader (open_reader) issues its follow-up range read against the returned meta.location, reads on a store with a prefix= resolved at prefix/prefix/key and 404'd. Mirror object_store's own fix (apache/arrow-rs-object-store#686) by stripping the prefix from the returned meta. Fixes #744 Co-Authored-By: Claude Opus 4.8 --- pyo3-object_store/src/prefix.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyo3-object_store/src/prefix.rs b/pyo3-object_store/src/prefix.rs index 78f3fc1a..6cf4861c 100644 --- a/pyo3-object_store/src/prefix.rs +++ b/pyo3-object_store/src/prefix.rs @@ -148,7 +148,9 @@ impl ObjectStore for MaybePrefixedStore { async fn get_opts(&self, location: &Path, options: GetOptions) -> Result { let full_path = self.full_path(location); - self.inner.get_opts(&full_path, options).await + let mut result = self.inner.get_opts(&full_path, options).await?; + result.meta = self.strip_meta(result.meta); + Ok(result) } async fn get_ranges(&self, location: &Path, ranges: &[Range]) -> Result> {