tensorstore.KvStore.__delitem__(self, key: str) None

Synchronously deletes a single key.

Example

>>> store = ts.KvStore.open({'driver': 'memory'}).result()
>>> store[b'a'] = b'value'
>>> store[b'a']
b'value'
>>> del store[b'a']
>>> store[b'a']
Traceback (most recent call last):
    ...
KeyError...
Parameters:
key: str

Key to delete. This is appended (without any separator) to the existing path, if any.

Raises:

Exception – If an I/O error occurs.

Note

  • If no transaction is specified, the current thread is blocked until the delete completes and durability is guaranteed (to the extent supported by the driver).

  • If a transaction is specified, the current thread is blocked until the delete is recorded in the transaction. The actual delete operation is not performed until the transaction is committed.

Computations in other threads may continue even while the current thread is blocked.