Skip to content

Commit c010c6e

Browse files
committed
Use pybytes in put
1 parent 726475a commit c010c6e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

obstore/src/put.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ use object_store::{
1212
};
1313
use pyo3::exceptions::PyValueError;
1414
use pyo3::prelude::*;
15-
use pyo3::pybacked::{PyBackedBytes, PyBackedStr};
15+
use pyo3::pybacked::PyBackedStr;
1616
use pyo3::types::PyDict;
17+
use pyo3_bytes::PyBytes;
1718
use pyo3_file::PyFileLikeObject;
1819
use pyo3_object_store::{PyObjectStore, PyObjectStoreResult};
1920

@@ -57,11 +58,11 @@ impl<'py> FromPyObject<'py> for PyUpdateVersion {
5758
}
5859

5960
/// Input types supported by multipart upload
60-
#[derive(Debug)]
61+
// #[derive(Debug)]
6162
pub(crate) enum MultipartPutInput {
6263
File(BufReader<File>),
6364
FileLike(PyFileLikeObject),
64-
Buffer(Cursor<PyBackedBytes>),
65+
Buffer(Cursor<PyBytes>),
6566
}
6667

6768
impl MultipartPutInput {
@@ -83,7 +84,7 @@ impl<'py> FromPyObject<'py> for MultipartPutInput {
8384
fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
8485
if let Ok(path) = ob.extract::<PathBuf>() {
8586
Ok(Self::File(BufReader::new(File::open(path)?)))
86-
} else if let Ok(buffer) = ob.extract::<PyBackedBytes>() {
87+
} else if let Ok(buffer) = ob.extract::<PyBytes>() {
8788
Ok(Self::Buffer(Cursor::new(buffer)))
8889
} else {
8990
Ok(Self::FileLike(PyFileLikeObject::with_requirements(

0 commit comments

Comments
 (0)