Skip to content

Commit 0a8c76c

Browse files
Abel Milashclaude
andcommitted
Revert example, README, and skill import changes to reduce PR diff
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 20311f6 commit 0a8c76c

7 files changed

Lines changed: 38 additions & 37 deletions

File tree

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ a PATCH request; multiple items use the `UpsertMultiple` bulk action.
209209
> upsert requests will be rejected by Dataverse with a 400 error.
210210
211211
```python
212-
from PowerPlatform.Dataverse.models import UpsertItem
212+
from PowerPlatform.Dataverse.models.upsert import UpsertItem
213213

214214
# Upsert a single record
215215
client.records.upsert("account", [
@@ -346,7 +346,7 @@ query = (client.query.builder("contact")
346346
For complex logic (OR, NOT, grouping), compose expressions with `&`, `|`, `~`:
347347

348348
```python
349-
from PowerPlatform.Dataverse.models import col
349+
from PowerPlatform.Dataverse.models.filters import col
350350

351351
# OR conditions: (statecode = 0 OR statecode = 1) AND revenue > 100k
352352
for record in (client.query.builder("account")
@@ -397,7 +397,7 @@ if record:
397397
**Nested expand with options** -- expand navigation properties with `$select`, `$filter`, `$orderby`, and `$top`:
398398

399399
```python
400-
from PowerPlatform.Dataverse.models import ExpandOption
400+
from PowerPlatform.Dataverse.models.query_builder import ExpandOption
401401

402402
# Expand related tasks with filtering and sorting
403403
for record in (client.query.builder("account")
@@ -614,14 +614,12 @@ client.tables.delete("new_Product")
614614
Create relationships between tables using the relationship API. For a complete working example, see [examples/advanced/relationships.py](https://github.com/microsoft/PowerPlatform-DataverseClient-Python/blob/main/examples/advanced/relationships.py).
615615

616616
```python
617-
from PowerPlatform.Dataverse.models import (
618-
CascadeConfiguration,
619-
Label,
620-
LocalizedLabel,
617+
from PowerPlatform.Dataverse.models.relationship import (
621618
LookupAttributeMetadata,
622-
ManyToManyRelationshipMetadata,
623619
OneToManyRelationshipMetadata,
620+
ManyToManyRelationshipMetadata,
624621
)
622+
from PowerPlatform.Dataverse.models.labels import Label, LocalizedLabel
625623

626624
# Create a one-to-many relationship: Department (1) -> Employee (N)
627625
# This adds a "Department" lookup field to the Employee table
@@ -823,7 +821,7 @@ The client raises structured exceptions for different error scenarios:
823821

824822
```python
825823
from PowerPlatform.Dataverse.client import DataverseClient
826-
from PowerPlatform.Dataverse.core import HttpError, ValidationError
824+
from PowerPlatform.Dataverse.core.errors import HttpError, ValidationError
827825

828826
try:
829827
client.records.retrieve("account", "invalid-id")
@@ -864,7 +862,8 @@ Enable file-based HTTP logging to capture all requests and responses for debuggi
864862

865863
```python
866864
from PowerPlatform.Dataverse.client import DataverseClient
867-
from PowerPlatform.Dataverse.core import DataverseConfig, LogConfig
865+
from PowerPlatform.Dataverse.core.config import DataverseConfig
866+
from PowerPlatform.Dataverse.core.log_config import LogConfig
868867

869868
log_cfg = LogConfig(
870869
log_folder="./my_logs", # Directory for log files (created if missing)

examples/advanced/alternate_keys_upsert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import time
2424

2525
from PowerPlatform.Dataverse.client import DataverseClient
26-
from PowerPlatform.Dataverse.models import UpsertItem
26+
from PowerPlatform.Dataverse.models.upsert import UpsertItem
2727
from azure.identity import InteractiveBrowserCredential # type: ignore
2828

2929
# --- Config ---

examples/advanced/relationships.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
import time
2121
from azure.identity import InteractiveBrowserCredential
2222
from PowerPlatform.Dataverse.client import DataverseClient
23-
from PowerPlatform.Dataverse.models import (
24-
CascadeConfiguration,
25-
Label,
26-
LocalizedLabel,
23+
from PowerPlatform.Dataverse.models.relationship import (
2724
LookupAttributeMetadata,
28-
ManyToManyRelationshipMetadata,
2925
OneToManyRelationshipMetadata,
26+
ManyToManyRelationshipMetadata,
27+
CascadeConfiguration,
3028
)
29+
from PowerPlatform.Dataverse.models.labels import Label, LocalizedLabel
3130
from PowerPlatform.Dataverse.common.constants import (
3231
CASCADE_BEHAVIOR_NO_CASCADE,
3332
CASCADE_BEHAVIOR_REMOVE_LINK,

examples/advanced/walkthrough.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
from enum import IntEnum
2626
from azure.identity import InteractiveBrowserCredential
2727
from PowerPlatform.Dataverse.client import DataverseClient
28-
from PowerPlatform.Dataverse.core import MetadataError
29-
from PowerPlatform.Dataverse.models import ExpandOption, col
28+
from PowerPlatform.Dataverse.core.errors import MetadataError
29+
from PowerPlatform.Dataverse.models.filters import col
30+
from PowerPlatform.Dataverse.models.query_builder import ExpandOption
3031
import requests
3132

3233

examples/basic/functional_testing.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,19 @@
3333

3434
# Import SDK components (assumes installation is already validated)
3535
from PowerPlatform.Dataverse.client import DataverseClient
36-
from PowerPlatform.Dataverse.core import HttpError, MetadataError
37-
from PowerPlatform.Dataverse.models import (
38-
CascadeConfiguration,
39-
Label,
40-
LocalizedLabel,
36+
from PowerPlatform.Dataverse.core.errors import HttpError, MetadataError
37+
from PowerPlatform.Dataverse.models.relationship import (
4138
LookupAttributeMetadata,
42-
ManyToManyRelationshipMetadata,
4339
OneToManyRelationshipMetadata,
44-
UpsertItem,
40+
ManyToManyRelationshipMetadata,
41+
CascadeConfiguration,
4542
)
43+
from PowerPlatform.Dataverse.models.labels import Label, LocalizedLabel
4644
from PowerPlatform.Dataverse.common.constants import (
4745
CASCADE_BEHAVIOR_NO_CASCADE,
4846
CASCADE_BEHAVIOR_REMOVE_LINK,
4947
)
48+
from PowerPlatform.Dataverse.models.upsert import UpsertItem
5049
from azure.identity import InteractiveBrowserCredential
5150

5251

examples/basic/installation_example.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@
6060
from typing import Optional
6161
from datetime import datetime
6262

63-
from PowerPlatform.Dataverse.operations import FileOperations, QueryOperations, RecordOperations, TableOperations
63+
from PowerPlatform.Dataverse.operations.records import RecordOperations
64+
from PowerPlatform.Dataverse.operations.query import QueryOperations
65+
from PowerPlatform.Dataverse.operations.tables import TableOperations
66+
from PowerPlatform.Dataverse.operations.files import FileOperations
6467

6568

6669
def validate_imports():
@@ -78,11 +81,11 @@ def validate_imports():
7881
print(f" [OK] Client class: PowerPlatform.Dataverse.client.DataverseClient")
7982

8083
# Test submodule imports
81-
from PowerPlatform.Dataverse.core import HttpError, MetadataError
84+
from PowerPlatform.Dataverse.core.errors import HttpError, MetadataError
8285

8386
print(f" [OK] Core errors: HttpError, MetadataError")
8487

85-
from PowerPlatform.Dataverse.core import DataverseConfig
88+
from PowerPlatform.Dataverse.core.config import DataverseConfig
8689

8790
print(f" [OK] Core config: DataverseConfig")
8891

src/PowerPlatform/Dataverse/claude_skill/dataverse-sdk-use/SKILL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ client.records.update("account", [id1, id2, id3], {"industry": "Technology"})
212212
Creates or updates records identified by alternate keys. Single item -> PATCH; multiple items -> `UpsertMultiple` bulk action.
213213
> **Prerequisite**: The table must have an alternate key configured in Dataverse for the columns used in `alternate_key`. Without it, Dataverse will reject the request with a 400 error.
214214
```python
215-
from PowerPlatform.Dataverse.models import UpsertItem
215+
from PowerPlatform.Dataverse.models.upsert import UpsertItem
216216

217217
# Single upsert
218218
client.records.upsert("account", [
@@ -403,12 +403,12 @@ client.tables.delete("new_Product")
403403

404404
#### Create One-to-Many Relationship
405405
```python
406-
from PowerPlatform.Dataverse.models import (
407-
CascadeConfiguration,
408-
Label,
409-
LocalizedLabel,
406+
from PowerPlatform.Dataverse.models.relationship import (
410407
LookupAttributeMetadata,
411408
OneToManyRelationshipMetadata,
409+
Label,
410+
LocalizedLabel,
411+
CascadeConfiguration,
412412
)
413413
from PowerPlatform.Dataverse.common.constants import CASCADE_BEHAVIOR_REMOVE_LINK
414414

@@ -435,7 +435,7 @@ print(f"Created lookup field: {result['lookup_schema_name']}")
435435

436436
#### Create Many-to-Many Relationship
437437
```python
438-
from PowerPlatform.Dataverse.models import ManyToManyRelationshipMetadata
438+
from PowerPlatform.Dataverse.models.relationship import ManyToManyRelationshipMetadata
439439

440440
relationship = ManyToManyRelationshipMetadata(
441441
schema_name="new_employee_project",
@@ -532,12 +532,12 @@ print(f"Succeeded: {len(result.succeeded)}, Failed: {len(result.failed)}")
532532
The SDK provides structured exceptions with detailed error information:
533533

534534
```python
535-
from PowerPlatform.Dataverse.core import (
535+
from PowerPlatform.Dataverse.core.errors import (
536536
DataverseError,
537537
HttpError,
538-
MetadataError,
539-
SQLParseError,
540538
ValidationError,
539+
MetadataError,
540+
SQLParseError
541541
)
542542
from PowerPlatform.Dataverse.client import DataverseClient
543543

0 commit comments

Comments
 (0)