Skip to content

Commit

Permalink
chore(deps): bump object_store to 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Mar 9, 2025
1 parent 9c2a5e4 commit a66f7a8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ version = "0.2.0"
path = "zarrs_zip"

[workspace.dependencies.object_store]
version = "0.11"
version = "0.12"

[workspace.dependencies.opendal]
version = "0.52.0"
Expand Down
3 changes: 3 additions & 0 deletions zarrs_object_store/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- **Breaking**: Bump `object_store` to 0.12.0

## [0.3.0] - 2024-11-15

### Added
Expand Down
4 changes: 2 additions & 2 deletions zarrs_object_store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zarrs_object_store"
version = "0.3.0"
version = "0.4.0"
authors = ["Lachlan Deakin <[email protected]>"]
edition = "2021"
rust-version = "1.77"
Expand All @@ -18,7 +18,7 @@ workspace = true
[dependencies]
async-trait = "0.1.74"
futures = "0.3.29"
object_store = { version = ">=0.9.0,<0.12", default-features = false }
object_store = { version = ">=0.12,<0.13", default-features = false }
zarrs_storage = { workspace = true, features = ["async"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion zarrs_object_store/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# zarrs_object_store

[![Latest Version](https://img.shields.io/crates/v/zarrs_object_store.svg)](https://crates.io/crates/zarrs_object_store)
[![object_store 0.11](https://img.shields.io/badge/object__store-0.11-blue)](https://crates.io/crates/object_store)
[![object_store 0.12](https://img.shields.io/badge/object__store-0.12-blue)](https://crates.io/crates/object_store)
[![zarrs_object_store documentation](https://docs.rs/zarrs_object_store/badge.svg)](https://docs.rs/zarrs_object_store)
![msrv](https://img.shields.io/crates/msrv/zarrs_object_store)
[![build](https://github.com/LDeakin/zarrs/actions/workflows/ci.yml/badge.svg)](https://github.com/LDeakin/zarrs/actions/workflows/ci.yml)
Expand Down
3 changes: 2 additions & 1 deletion zarrs_object_store/doc/version_compatibility_matrix.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
| [zarrs_object_store] | [object_store] | [zarrs] ([zarrs_storage]) |
| -------------------- | -------------- | ------------------------- |
| 0.4 | 0.12 | 0.18+ (0.3.0) |
| 0.3 | 0.9-0.11 | 0.18+ (0.3.0) |
| 0.2 | 0.9-0.11 | 0.17 (0.2.0) |
| 0.3 | 0.9-0.11 | 0.18 (0.3.0) |

[zarrs_object_store]: https://crates.io/crates/zarrs_object_store
[object_store]: https://crates.io/crates/object_store
Expand Down
13 changes: 7 additions & 6 deletions zarrs_object_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl<T: object_store::ObjectStore> AsyncReadableStorageTraits for AsyncObjectSto
};
let ranges = byte_ranges
.iter()
.map(|byte_range| byte_range.to_range_usize(size))
.map(|byte_range| byte_range.to_range(size))
.collect::<Vec<_>>();
let get_ranges = self
.object_store
Expand All @@ -116,12 +116,13 @@ impl<T: object_store::ObjectStore> AsyncReadableStorageTraits for AsyncObjectSto
Ok(get_ranges) => Ok(Some(
std::iter::zip(ranges, get_ranges)
.map(|(range, bytes)| {
if range.len() == bytes.len() {
let range_len = range.end.saturating_sub(range.start);
if range_len == bytes.len() as u64 {
Ok(bytes)
} else {
Err(StorageError::Other(format!(
"Unexpected length of bytes returned, expected {}, got {}",
range.len(),
range_len,
bytes.len()
)))
}
Expand All @@ -141,7 +142,7 @@ impl<T: object_store::ObjectStore> AsyncReadableStorageTraits for AsyncObjectSto
async fn size_key(&self, key: &StoreKey) -> Result<Option<u64>, StorageError> {
Ok(
handle_result_notfound(self.object_store.head(&key_to_path(key)).await)?
.map(|meta| meta.size as u64),
.map(|meta| meta.size),
)
}
}
Expand Down Expand Up @@ -254,7 +255,7 @@ impl<T: object_store::ObjectStore> AsyncListableStorageTraits for AsyncObjectSto
let mut size = 0;
while let Some(item) = locations.next().await {
let meta = handle_result(item)?;
size += u64::try_from(meta.size).unwrap();
size += meta.size;
}
Ok(size)
}
Expand All @@ -264,7 +265,7 @@ impl<T: object_store::ObjectStore> AsyncListableStorageTraits for AsyncObjectSto
let mut size = 0;
while let Some(item) = locations.next().await {
let meta = handle_result(item)?;
size += u64::try_from(meta.size).unwrap();
size += meta.size;
}
Ok(size)
}
Expand Down

0 comments on commit a66f7a8

Please sign in to comment.