Skip to content

Conversation

@zhaodongwang-msft
Copy link
Collaborator

@zhaodongwang-msft zhaodongwang-msft commented Nov 10, 2025

Updated delete with a new delete_async method and use DeleteMultiple for delete when it's an elastic table

Copilot summary:
This pull request updates the Dataverse SDK to improve how bulk deletes are handled and introduces a new asynchronous bulk delete method. The changes clarify the behavior of the delete method, add a new delete_async method for better performance when deleting multiple records, and update documentation and examples to reflect these improvements.

Bulk Delete API Improvements

  • Changed the delete method in client.py so that it always returns None and performs sequential deletes for standard tables, while using DeleteMultiple for elastic tables. The bulk delete job ID is no longer returned from this method. [1] [2]
  • Added a new delete_async method to client.py that issues an asynchronous BulkDelete job for one or more records and returns the BulkDelete job identifier. This is recommended for better performance when deleting many records.
  • Implemented _is_elastic_table in odata.py to determine if a table is elastic, and refactored _delete_multiple and _delete_async to support the new delete logic. [1] [2] [3]

Documentation Updates

  • Updated the README.md to clarify the behavior of delete and document the new delete_async method, including return types and usage recommendations. [1] [2] [3] [4] [5]

Example Code Updates

  • Modified examples/quickstart.py to demonstrate the use of delete_async for bulk deletes and updated logging to match the new API.
  • Improved cleanup logic in quickstart.py to handle elastic table deletion more robustly.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors the Dataverse SDK's delete operations to better handle bulk deletes and introduces asynchronous bulk delete capabilities. The key changes differentiate between elastic and standard tables, optimize delete operations accordingly, and provide users with more control over delete performance.

Key Changes

  • Introduced delete_async method for asynchronous bulk deletes using BulkDelete API
  • Modified delete method to automatically use DeleteMultiple for elastic tables and sequential deletes for standard tables
  • Added _is_elastic_table helper method with caching to determine table type

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/dataverse_sdk/client.py Added delete_async method and updated delete to automatically choose between DeleteMultiple (elastic) and sequential deletes (standard)
src/dataverse_sdk/odata.py Implemented _is_elastic_table with caching, refactored _delete_multiple to use DeleteMultiple action, and _delete_async signature changes
README.md Updated documentation to describe new delete_async method and clarify delete behavior for elastic vs standard tables
examples/quickstart.py Updated to use delete_async for bulk deletes and improved cleanup logic for elastic tables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

zhaodongwang-msft and others added 6 commits November 10, 2025 13:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zhaodongwang-msft zhaodongwang-msft requested a review from a team as a code owner November 14, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants