-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document design decision for functional API #160
Comments
Yes, I agree that it would be nice to have the methods directly on the class, however this is a very intentional design decision, Simpler Rust codeOn the Rust side, each Python class is a separate Simpler MiddlewaresIn #117 we added a binding for obstore/pyo3-object_store/src/prefix.rs Lines 10 to 25 in b40d59b
If we exposed methods on an External FFI for ObjectStoreThere was recently discussion on Discord about the merits of having a stable FFI for I use a similar functional API in other Python bindings, especially in cases with zero-copy FFI, such as https://kylebarron.dev/geo-index/latest/api/rtree/#geoindex_rs.rtree.search (where the spatial index is passed in as the first argument instead) and https://kylebarron.dev/arro3/latest/api/compute/#arro3.compute.cast where the Smaller core for third-party Rust bindingsThis repo has twin goals:
The first goal is served by the #[pyfunction]
fn use_object_store(store: PyObjectStore) {
let store: Arc<dyn ObjectStore> = store.into_inner();
} Those third party bindings don't need the Python bindings to perform arbitrary You'll notice that |
It felt a bit unintuitive to have to do provide the store each time to execute a method:
Instead of having the methods on the store directly akin to the rust implementation:
The text was updated successfully, but these errors were encountered: