Skip to content

Commit

Permalink
add atomic-argument to UrlOperations
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-monch committed Apr 18, 2024
1 parent 842114a commit 407abfb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions datalad_next/url_operations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def upload(self,
*,
credential: str | None = None,
hash: list[str] | None = None,
timeout: float | None = None) -> Dict:
timeout: float | None = None,
atomic: bool = False) -> Dict:
"""Upload from a local file or stream to a URL
Parameters
Expand All @@ -203,6 +204,11 @@ def upload(self,
If given, specifies a timeout in seconds. If the operation is not
completed within this time, it will raise a `TimeoutError`-exception.
If timeout is None, the operation will never timeout.
atomic: bool, optional, default: ``False``
If ``True``, the upload is performed atomically. This means that the
destination will never see a partially uploaded file. It will either
see the previous content (or nothing) or the newly uploaded content.
Note: this is not supported by all implementations of URL-operations.
Returns
-------
Expand Down Expand Up @@ -362,6 +368,3 @@ def _with_progress(self,
end_log_msg
)
)



0 comments on commit 407abfb

Please sign in to comment.