Skip to content

Commit 400854c

Browse files
author
Alex Kwiatkowski
committed
wip: add put_opts & put_multipart
1 parent 445e9d7 commit 400854c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

object-store/python/object_store/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,23 @@ def put(self, location: PathLike, bytes: BytesLike) -> None:
8989
"""
9090
return super().put(_as_path(location), _as_bytes(bytes))
9191

92+
def put_opts(self, location: PathLike, bytes: BytesLike) -> None:
93+
"""Save the provided bytes to the specified location with the given options
94+
95+
Args:
96+
location (PathLike): path / key to storage location
97+
bytes (BytesLike): data to be written to location
98+
"""
99+
return super().put_opts(_as_path(location), _as_bytes(bytes))
100+
101+
def put_multipart(self, location: PathLike) -> None:
102+
"""Perform a multipart upload
103+
104+
Args:
105+
location (PathLike): path / key to storage location
106+
"""
107+
return super().put_multipart(_as_path(location))
108+
92109
def delete(self, location: PathLike) -> None:
93110
"""Delete the object at the specified location.
94111

object-store/python/object_store/_internal.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ class ObjectStore:
135135
"""Return the bytes that are stored at the specified location in the given byte range."""
136136
def put(self, location: Path, bytes: bytes) -> None:
137137
"""Save the provided bytes to the specified location."""
138+
def put_opts(self, location: Path, bytes: bytes) -> None:
139+
"""Save the provided bytes to the specified location with the given options"""
140+
def put_multipart(self, location: Path) -> None:
141+
"""Perform a multipart upload"""
138142
def list(self, prefix: Path | None) -> list[ObjectMeta]:
139143
"""List all the objects with the given prefix.
140144

0 commit comments

Comments
 (0)