-
Notifications
You must be signed in to change notification settings - Fork 8
Users/zhaodongwang/delete update #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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_asyncmethod for asynchronous bulk deletes using BulkDelete API - Modified
deletemethod to automatically useDeleteMultiplefor elastic tables and sequential deletes for standard tables - Added
_is_elastic_tablehelper 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…microsoft/PowerPlatform-DataverseClient-Python into users/zhaodongwang/deleteUpdate
…averseClient-Python into users/zhaodongwang/deleteUpdate
…averseClient-Python into users/zhaodongwang/deleteUpdate
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
deletemethod, add a newdelete_asyncmethod for better performance when deleting multiple records, and update documentation and examples to reflect these improvements.Bulk Delete API Improvements
deletemethod inclient.pyso that it always returnsNoneand performs sequential deletes for standard tables, while usingDeleteMultiplefor elastic tables. The bulk delete job ID is no longer returned from this method. [1] [2]delete_asyncmethod toclient.pythat 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._is_elastic_tableinodata.pyto determine if a table is elastic, and refactored_delete_multipleand_delete_asyncto support the new delete logic. [1] [2] [3]Documentation Updates
README.mdto clarify the behavior ofdeleteand document the newdelete_asyncmethod, including return types and usage recommendations. [1] [2] [3] [4] [5]Example Code Updates
examples/quickstart.pyto demonstrate the use ofdelete_asyncfor bulk deletes and updated logging to match the new API.quickstart.pyto handle elastic table deletion more robustly.