Skip to content

Commit

Permalink
wip: add put_opts & put_multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
rupurt committed Apr 5, 2024
1 parent 445e9d7 commit 400854c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions object-store/python/object_store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ def put(self, location: PathLike, bytes: BytesLike) -> None:
"""
return super().put(_as_path(location), _as_bytes(bytes))

def put_opts(self, location: PathLike, bytes: BytesLike) -> None:
"""Save the provided bytes to the specified location with the given options
Args:
location (PathLike): path / key to storage location
bytes (BytesLike): data to be written to location
"""
return super().put_opts(_as_path(location), _as_bytes(bytes))

def put_multipart(self, location: PathLike) -> None:
"""Perform a multipart upload
Args:
location (PathLike): path / key to storage location
"""
return super().put_multipart(_as_path(location))

def delete(self, location: PathLike) -> None:
"""Delete the object at the specified location.
Expand Down
4 changes: 4 additions & 0 deletions object-store/python/object_store/_internal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ class ObjectStore:
"""Return the bytes that are stored at the specified location in the given byte range."""
def put(self, location: Path, bytes: bytes) -> None:
"""Save the provided bytes to the specified location."""
def put_opts(self, location: Path, bytes: bytes) -> None:
"""Save the provided bytes to the specified location with the given options"""
def put_multipart(self, location: Path) -> None:
"""Perform a multipart upload"""
def list(self, prefix: Path | None) -> list[ObjectMeta]:
"""List all the objects with the given prefix.
Expand Down

0 comments on commit 400854c

Please sign in to comment.