Skip to content

feat: upgrade object store 0.13.x - #600

Merged
alukach merged 3 commits into
mainfrom
feat/upgrade-object-store-0.13.x
Jan 12, 2026
Merged

alukach merged 3 commits into
mainfrom
feat/upgrade-object-store-0.13.x

Conversation

@alukach

@alukach alukach commented Jan 12, 2026

Copy link
Copy Markdown
Member

In this PR, we upgrade our dependencies to make use of object_store==0.13.0. The largest change was that the introduction of ObjectStoreExt (https://github.com/apache/arrow-rs-object-store/blob/v0.13.0/src/lib.rs#L1211) which removes the need for manually declaring RESTful methods in pyo3-object_store/src/prefix.rs. Additionally, it introduced the requirement for copy_opts() and delete_stream on traits that impl<T: ObjectStore> ObjectStore.

Finally, we needed to adapt if/else calls to the ObjectStoreExt methods to work around the opaque impl Future types. We acheive this by type-erasing these types via Box::pin.

before/after

before

let fut = if overwrite {
    store.as_ref().rename(&from_, &to)
} else {
    store.as_ref().rename_if_not_exists(&from_, &to)
};

after

let fut: Pin<Box<dyn Future<Output = _> + Send>> = if overwrite {
    Box::pin(store.as_ref().rename(&from_, &to))
} else {
    Box::pin(store.as_ref().rename_if_not_exists(&from_, &to))
};

closes #598

@alukach
alukach requested a review from kylebarron January 12, 2026 22:17
@github-actions github-actions Bot added the feat label Jan 12, 2026
@alukach
alukach force-pushed the feat/upgrade-object-store-0.13.x branch from 1cf2500 to 02e0572 Compare January 12, 2026 22:18
@alukach
alukach enabled auto-merge (squash) January 12, 2026 22:18
@alukach
alukach disabled auto-merge January 12, 2026 22:19
@alukach
alukach enabled auto-merge (squash) January 12, 2026 22:19
@alukach
alukach disabled auto-merge January 12, 2026 22:19
@alukach
alukach enabled auto-merge (squash) January 12, 2026 22:19
@alukach
alukach merged commit a2ca349 into main Jan 12, 2026
7 checks passed
@alukach
alukach deleted the feat/upgrade-object-store-0.13.x branch January 12, 2026 22:20
@alukach

alukach commented Jan 12, 2026

Copy link
Copy Markdown
Member Author

🤦 gah!!! I assumed the auto-merge would require an approval from a reviewer!!! 😶‍🌫️

@kylebarron we can revert or force push that commit away on main if this isn't yet ready

@kylebarron

kylebarron commented Jan 13, 2026 •

Copy link
Copy Markdown
Member

I don't have reviewer approval required because most of the time it's just me creating PRs and no one realistically reviews them

Comment thread obstore/src/copy.rs
let fut = if overwrite {
store.as_ref().copy(&from_, &to)
let fut: Pin<Box<dyn Future<Output = _> + Send>> = if overwrite {
Box::pin(store.as_ref().copy(&from_, &to))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We need the box because now each variant has a different physical return type...?

@alukach alukach Jan 13, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moreso, a consequence of an opaque type.

Here's what we see without using a Box::pin:

error[E0308]: `if` and `else` have incompatible types
  --> obstore/src/copy.rs:26:13
   |
23 |           let fut = if overwrite {
   |  ___________________-
24 | |             store.as_ref().copy(&from_, &to)
   | |             -------------------------------- expected because of this
25 | |         } else {
26 | |             store.as_ref().copy_if_not_exists(&from_, &to)
   | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `<T as ObjectStoreExt>::copy::{opaque#0}`, found `<T as ObjectStoreExt>::copy_if_not_exists::{opaque#0}`
27 | |         };
   | |_________- `if` and `else` have incompatible types
   |
   = note: expected opaque type `impl futures::Future<Output = Result<(), object_store::Error>>`
              found opaque type `impl futures::Future<Output = Result<(), object_store::Error>>`
   = note: distinct uses of `impl Trait` result in different opaque types

In 0.12.5, ObjectStore::copy() was an async func returning a result:

async fn copy(&self, from: &Path, to: &Path) -> Result<()>;

In 0.13.0, ObjectStore::copy() returns a Future of a result:

fn copy(&self, from: &Path, to: &Path) -> impl Future<Output = Result<()>>;

This is apparently opaque to the typechecker.

ObjectStoreExt::copy() is an async func returning a result, like v0.12.x, however I'm not sure if we should make use of that:

async fn copy(&self, from: &Path, to: &Path) -> Result<()>;


use object_store::path::Path;
use object_store::{path::Path, CopyOptions};
// Remove when updating to object_store 0.13

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should adjust code for this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump to object_store 0.13

2 participants