@@ -6,7 +6,9 @@ use bytes::Bytes;
66use chrono:: { DateTime , Utc } ;
77use futures:: stream:: { BoxStream , Fuse } ;
88use futures:: StreamExt ;
9- use object_store:: { Attributes , GetOptions , GetRange , GetResult , ObjectMeta , ObjectStore } ;
9+ use object_store:: {
10+ Attributes , GetOptions , GetRange , GetResult , ObjectMeta , ObjectStore , ObjectStoreExt ,
11+ } ;
1012use pyo3:: exceptions:: { PyStopAsyncIteration , PyStopIteration , PyValueError } ;
1113use pyo3:: prelude:: * ;
1214use pyo3_async_runtimes:: tokio:: get_runtime;
@@ -347,7 +349,7 @@ pub(crate) fn get(
347349 let fut = if let Some ( options) = options {
348350 store. as_ref ( ) . get_opts ( path, options. into ( ) )
349351 } else {
350- store. as_ref ( ) . get ( path)
352+ Box :: pin ( store. as_ref ( ) . get ( path) )
351353 } ;
352354 let out = runtime. block_on ( fut) ?;
353355 Ok :: < _ , PyObjectStoreError > ( PyGetResult :: new ( out) )
@@ -367,7 +369,7 @@ pub(crate) fn get_async(
367369 let fut = if let Some ( options) = options {
368370 store. as_ref ( ) . get_opts ( path, options. into ( ) )
369371 } else {
370- store. as_ref ( ) . get ( path)
372+ Box :: pin ( store. as_ref ( ) . get ( path) )
371373 } ;
372374 let out = fut. await . map_err ( PyObjectStoreError :: ObjectStoreError ) ?;
373375 Ok ( PyGetResult :: new ( out) )
0 commit comments