Azrue Table - Batch delete or Multi Delete

ash 26 Reputation points

Is it still possible to perform a batch delete or multi delete operation in a single execution?

As per pypi library of release update 12.0.0b7 (2021-05-11) it stats the following

Removed the TableClient.create_batch method along with the TableBatchOperations object. The transactional batching is now supported via a simple Python list of tuples.

So wondering if batch or multi delete is still possible using python.

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
141 questions
{count} vote

Accepted answer
  1. GeethaThatipatri-MSFT 23,602 Reputation points Microsoft Employee

    Hi, @ash batch delete is still supported - here's a sample:
    The sample shows a batch with various upsert/update operations, but this could be all 'delete' operations and yes, you could more efficiently delete asynchronously by doing the operations concurrently rather than one by one
    Something like this:
    delete_tasks = [client.delete_entity(partition_key=str(0), row_key=c) for c in customer_list]
    await asyncio.wait(delete_tasks)
    there are various other tools in the asyncio module for running tasks concurrently:

    I hope this information helps


0 additional answers

Sort by: Most helpful