Skip to content

Edit docstring for Copy #21

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/obspec/_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,27 @@ class Copy(Protocol):
def copy(self, from_: str, to: str, *, overwrite: bool = True) -> None:
"""Copy an object from one path to another in the same object store.

All paths should be a fragment relative to the bucket root or any prefix already
assigned on the store. I.e. `path/to/file.txt`, not
`s3://bucket/path/to/file.txt`.

Args:
from_: Source path
from_: Source path.
to: Destination path

Keyword Args:
overwrite: If `True`, if there exists an object at the destination, it will
overwrite: whether to overwrite the destination object if one already
exists.

- If `True`, if there exists an object at the destination, it will
be overwritten.

If `False`: will copy only if destination is empty. Performs an atomic
- If `False`: will copy only if destination is empty. Performs an atomic
operation if the underlying object storage supports it. If atomic
operations are not supported by the underlying object storage (like S3)
it will return an error.
operations are not supported by the underlying object storage it will
return an error.

Will return an error if the destination already has an object.
Will return an error if the destination already has an object.

"""

Expand Down
Loading