Skip to content

Commit dc5834e

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 ff7f47c commit dc5834e

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
@@ -332,12 +332,7 @@ def _create(self, entity_set: str, table_schema_name: str, record: Dict[str, Any
332332
f"Create response missing GUID in OData-EntityId/Location headers (status={getattr(r,'status_code', '?')}). Headers: {header_keys}"
333333
)
334334

335-
def _create_multiple(
336-
self,
337-
entity_set: str,
338-
table_schema_name: str,
339-
records: List[Dict[str, Any]],
340-
) -> List[str]:
335+
def _create_multiple(self, entity_set: str, table_schema_name: str, records: List[Dict[str, Any]]) -> List[str]:
341336
"""Create multiple records using the collection-bound ``CreateMultiple`` action.
342337
343338
Large record lists are automatically split into chunks of up to
@@ -354,9 +349,7 @@ def _create_multiple(
354349
:rtype: ``list[str]``
355350
356351
.. note::
357-
Logical type stamping: if any payload omits ``@odata.type`` the client
358-
injects ``Microsoft.Dynamics.CRM.<table_logical_name>``. If all payloads
359-
already include ``@odata.type`` no modification occurs.
352+
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.
360353
361354
.. warning::
362355
When input exceeds ``_MULTIPLE_BATCH_SIZE`` records, the operation is
@@ -513,7 +506,6 @@ def _upsert_multiple(
513506
for i in range(0, len(targets), _MULTIPLE_BATCH_SIZE):
514507
chunk = targets[i : i + _MULTIPLE_BATCH_SIZE]
515508
self._request("post", url, json={"Targets": chunk}, expected=(200, 201, 204))
516-
return None
517509

518510
# --- Derived helpers for high-level client ergonomics ---
519511
def _primary_id_attr(self, table_schema_name: str) -> str:
@@ -633,12 +625,7 @@ def _update(self, table_schema_name: str, key: str, data: Dict[str, Any]) -> Non
633625
"""
634626
self._execute_raw(self._build_update(table_schema_name, key, data))
635627

636-
def _update_multiple(
637-
self,
638-
entity_set: str,
639-
table_schema_name: str,
640-
records: List[Dict[str, Any]],
641-
) -> None:
628+
def _update_multiple(self, entity_set: str, table_schema_name: str, records: List[Dict[str, Any]]) -> None:
642629
"""Bulk update existing records via the collection-bound ``UpdateMultiple`` action.
643630
644631
Large record lists are automatically split into chunks of up to

0 commit comments

Comments
 (0)