Azrue Table - Batch delete or Multi Delete

ash 66 Reputation points
2022-10-26T18:17:11.547+00:00

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

As per pypi library of Azure.data.table- 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.
171 questions
{count} vote

Accepted answer
  1. GeethaThatipatri-MSFT 29,482 Reputation points Microsoft Employee
    2022-11-10T21:22:05.75+00:00

    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:
    https://docs.python.org/3/library/asyncio-task.html#waiting-primitives

    I hope this information helps

    Regards
    Geetha


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.