You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/dataverse-sdk-use/SKILL.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Use the PowerPlatform Dataverse Client Python SDK to interact with Microsoft Dat
25
25
-`client.batch` -- batch multiple operations into a single HTTP request
26
26
27
27
### Bulk Operations
28
-
The SDK supports Dataverse's native bulk operations: Pass lists to `create()`, `update()`, or `upsert()` for automatic bulk processing; for `delete()`, set `use_bulk_delete=True`. Lists exceeding 1,000 records are automatically split into 1,000-record chunks — no manual pre-splitting needed. By default chunks are dispatched sequentially; pass `max_workers=N` (recommended: 3–4) to dispatch chunks concurrently via threads. Operations across chunks are **not atomic**: a failure mid-way may leave earlier chunks applied. Callers that require atomicity should limit their input to ≤ 1,000 records.
28
+
The SDK supports Dataverse's native bulk operations: Pass lists to `create()`, `update()`, or `upsert()` for automatic bulk processing; for `delete()`, pass a list and set `use_bulk_delete=True` to use bulk operation. Lists exceeding 1,000 records are automatically split into 1,000-record chunks — no manual pre-splitting needed. By default chunks are dispatched sequentially; pass `max_workers=N` (max: 3, default: 1) to dispatch chunks concurrently via threads. Operations across chunks are **not atomic**: a failure mid-way may leave earlier chunks applied. Callers that require atomicity should limit their input to ≤ 1,000 records.
29
29
30
30
### Paging
31
31
- Control page size with `page_size` parameter
@@ -465,12 +465,11 @@ except ValidationError as e:
465
465
### Performance Optimization
466
466
467
467
1.**Use bulk operations** - Pass lists to create/update/delete for automatic optimization
468
-
2.**Use `max_workers`** - Pass `max_workers=3` (or 4) to dispatch 1,000-record chunks concurrently; safe for large datasets where throughput matters more than strict sequential ordering. Dataverse throttles concurrent requests server-side, so values above 4 rarely help and may trigger 429 rate-limiting
469
-
3.**Specify select fields** - Limit returned columns to reduce payload size
470
-
4.**Control page size** - Use `top` and `page_size` parameters appropriately
471
-
5.**Reuse client instances** - Don't create new clients for each operation
472
-
6.**Use production credentials** - ClientSecretCredential or CertificateCredential for unattended operations
473
-
7.**Error handling** - Implement retry logic for transient errors (`e.is_transient`)
468
+
2.**Specify select fields** - Limit returned columns to reduce payload size
469
+
3.**Control page size** - Use `top` and `page_size` parameters appropriately
470
+
4.**Reuse client instances** - Don't create new clients for each operation
471
+
5.**Use production credentials** - ClientSecretCredential or CertificateCredential for unattended operations
472
+
6.**Error handling** - Implement retry logic for transient errors (`e.is_transient`)
474
473
7.**Always include customization prefix** for custom tables/columns
475
474
8.**Use lowercase for column names, match `$metadata` for navigation properties** - Column names in `$select`/`$filter`/record payloads use lowercase LogicalNames. Navigation properties in `$expand` and `@odata.bind` keys are case-sensitive and must match the entity's `$metadata` (PascalCase for custom lookups like `new_CustomerId`, lowercase for system lookups like `parentaccountid`)
Copy file name to clipboardExpand all lines: src/PowerPlatform/Dataverse/claude_skill/dataverse-sdk-use/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Use the PowerPlatform Dataverse Client Python SDK to interact with Microsoft Dat
25
25
-`client.batch` -- batch multiple operations into a single HTTP request
26
26
27
27
### Bulk Operations
28
-
The SDK supports Dataverse's native bulk operations: Pass lists to `create()`, `update()`, or `upsert()` for automatic bulk processing; for `delete()`, set `use_bulk_delete=True`. Lists exceeding 1,000 records are automatically split into 1,000-record chunks — no manual pre-splitting needed. By default chunks are dispatched sequentially; pass `max_workers=N` (recommended: 3–4) to dispatch chunks concurrently via threads. Operations across chunks are **not atomic**: a failure mid-way may leave earlier chunks applied. Callers that require atomicity should limit their input to ≤ 1,000 records.
28
+
The SDK supports Dataverse's native bulk operations: Pass lists to `create()`, `update()`, or `upsert()` for automatic bulk processing; for `delete()`, pass a list and set `use_bulk_delete=True` to use bulk operation. Lists exceeding 1,000 records are automatically split into 1,000-record chunks — no manual pre-splitting needed. By default chunks are dispatched sequentially; pass `max_workers=N` (max: 3, default: 1) to dispatch chunks concurrently via threads. Operations across chunks are **not atomic**: a failure mid-way may leave earlier chunks applied. Callers that require atomicity should limit their input to ≤ 1,000 records.
self._picklist_cache_lock=threading.Lock() # serialises cold-start fetches under concurrent workers
260
+
self._picklist_cache_lock=threading.Lock() # prevents concurrent threads from making duplicate picklist metadata fetches on cold start
252
261
253
262
@contextmanager
254
263
def_call_scope(self):
@@ -431,23 +440,21 @@ def _create_multiple(
431
440
``1`` (default) dispatches sequentially.
432
441
:type max_workers: ``int``
433
442
434
-
:return: List of created record GUIDs in chunk-submission order
435
-
(may be empty if response lacks IDs).
443
+
:return: List of created record GUIDs (may be empty if response lacks IDs).
436
444
:rtype: ``list[str]``
437
445
438
446
.. note::
439
447
Logical type stamping: if any payload omits ``@odata.type`` the client injects ``Microsoft.Dynamics.CRM.<table_logical_name>``. If all payloads already include ``@odata.type`` no modification occurs.
440
448
441
449
.. warning::
442
-
When input exceeds ``_MULTIPLE_BATCH_SIZE`` records, the operation is
443
-
split into multiple requests and is **not atomic**. If a later batch
444
-
fails, earlier batches are already committed. Callers that require
445
-
atomicity should limit input to ``<= _MULTIPLE_BATCH_SIZE`` records.
450
+
When input exceeds ``_MULTIPLE_BATCH_SIZE`` records, the operation is split into multiple requests
451
+
and is **not atomic**. If a later batch fails, earlier batches are already committed. Callers
452
+
that require atomicity should limit input to ``<= _MULTIPLE_BATCH_SIZE`` records.
446
453
"""
447
454
ifnotall(isinstance(r, dict) forrinrecords):
448
455
raiseTypeError("All items for multi-create must be dicts")
0 commit comments