Skip to content

Commit 6cc5b6a

Browse files
Abel Milashclaude
andcommitted
Restore method signatures and note formatting to match main
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a9b2b5c commit 6cc5b6a

2 files changed

Lines changed: 9 additions & 24 deletions

File tree

examples/advanced/walkthrough.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- pip install azure-identity
2020
"""
2121

22-
import sys
22+
import argparse
2323
import json
2424
import time
2525
from enum import IntEnum
@@ -69,6 +69,11 @@ def backoff(op, *, delays=(0, 2, 5, 10, 20, 20)):
6969

7070

7171
def main():
72+
parser = argparse.ArgumentParser(description="Dataverse SDK Walkthrough")
73+
parser.add_argument("--url", help="Dataverse org URL (e.g. https://yourorg.crm.dynamics.com)")
74+
args = parser.parse_args()
75+
base_url = args.url.rstrip("/")
76+
7277
print("=" * 80)
7378
print("Dataverse SDK Walkthrough")
7479
print("=" * 80)
@@ -80,13 +85,6 @@ def main():
8085
print("1. Setup & Authentication")
8186
print("=" * 80)
8287

83-
base_url = input("Enter Dataverse org URL (e.g. https://yourorg.crm.dynamics.com): ").strip()
84-
if not base_url:
85-
print("No URL entered; exiting.")
86-
sys.exit(1)
87-
88-
base_url = base_url.rstrip("/")
89-
9088
log_call("InteractiveBrowserCredential()")
9189
credential = InteractiveBrowserCredential()
9290

src/PowerPlatform/Dataverse/data/_odata.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,7 @@ def _create(self, entity_set: str, table_schema_name: str, record: Dict[str, Any
361361
f"Create response missing GUID in OData-EntityId/Location headers (status={getattr(r,'status_code', '?')}). Headers: {header_keys}"
362362
)
363363

364-
def _create_multiple(
365-
self,
366-
entity_set: str,
367-
table_schema_name: str,
368-
records: List[Dict[str, Any]],
369-
) -> List[str]:
364+
def _create_multiple(self, entity_set: str, table_schema_name: str, records: List[Dict[str, Any]]) -> List[str]:
370365
"""Create multiple records using the collection-bound ``CreateMultiple`` action.
371366
372367
Large record lists are automatically split into chunks of up to
@@ -383,9 +378,7 @@ def _create_multiple(
383378
:rtype: ``list[str]``
384379
385380
.. note::
386-
Logical type stamping: if any payload omits ``@odata.type`` the client
387-
injects ``Microsoft.Dynamics.CRM.<table_logical_name>``. If all payloads
388-
already include ``@odata.type`` no modification occurs.
381+
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.
389382
390383
.. warning::
391384
When input exceeds ``_MULTIPLE_BATCH_SIZE`` records, the operation is
@@ -542,7 +535,6 @@ def _upsert_multiple(
542535
for i in range(0, len(targets), _MULTIPLE_BATCH_SIZE):
543536
chunk = targets[i : i + _MULTIPLE_BATCH_SIZE]
544537
self._request("post", url, json={"Targets": chunk}, expected=(200, 201, 204))
545-
return None
546538

547539
# --- Derived helpers for high-level client ergonomics ---
548540
def _primary_id_attr(self, table_schema_name: str) -> str:
@@ -662,12 +654,7 @@ def _update(self, table_schema_name: str, key: str, data: Dict[str, Any]) -> Non
662654
"""
663655
self._execute_raw(self._build_update(table_schema_name, key, data))
664656

665-
def _update_multiple(
666-
self,
667-
entity_set: str,
668-
table_schema_name: str,
669-
records: List[Dict[str, Any]],
670-
) -> None:
657+
def _update_multiple(self, entity_set: str, table_schema_name: str, records: List[Dict[str, Any]]) -> None:
671658
"""Bulk update existing records via the collection-bound ``UpdateMultiple`` action.
672659
673660
Large record lists are automatically split into chunks of up to

0 commit comments

Comments
 (0)