Skip to content

Delete

Delete operations.

Obstore provides two API designs for your convenience.

Method API

obstore.store.ObjectStoreMethods.delete

delete(paths: str | Sequence[str]) -> None

Delete the object at the specified location(s).

Refer to the documentation for delete.

obstore.store.ObjectStoreMethods.delete_async async

delete_async(paths: str | Sequence[str]) -> None

Call delete asynchronously.

Refer to the documentation for delete_async.

Functional API

obstore.delete

delete(store: ObjectStore, paths: str | Sequence[str]) -> None

Delete the object at the specified location(s).

Parameters:

  • store (ObjectStore) –

    The ObjectStore instance to use.

  • paths (str | Sequence[str]) –

    The path or paths within the store to delete.

When supported by the underlying store, this method will use bulk operations that delete more than one object per a request.

The following backends support native bulk delete operations:

  • AWS (S3): Uses the native DeleteObjects API with batches of up to 1000 objects
  • Azure: Uses the native Blob Batch API with batches of up to 256 objects

The following backends use concurrent individual delete operations:

  • GCP: Performs individual delete requests with up to 10 concurrent operations
  • HTTP: Performs individual delete requests with up to 10 concurrent operations
  • Local: Performs individual file deletions with up to 10 concurrent operations
  • Memory: Performs individual in-memory deletions sequentially

If the object did not exist, the result may be an error or a success, depending on the behavior of the underlying store. For example, local filesystems, GCP, and Azure return an error, while S3 and in-memory will return Ok.

obstore.delete_async async

delete_async(store: ObjectStore, paths: str | Sequence[str]) -> None

Call delete asynchronously.

Refer to the documentation for delete.