Skip to content

Commit 0146b6b

Browse files
Abel Milashclaude
andcommitted
Update remaining deep imports to module-level imports in docstrings and examples
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0a8c76c commit 0146b6b

19 files changed

Lines changed: 474 additions & 62 deletions

README.md

Lines changed: 10 additions & 9 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.upsert import UpsertItem
212+
from PowerPlatform.Dataverse.models 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.filters import col
349+
from PowerPlatform.Dataverse.models 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.query_builder import ExpandOption
400+
from PowerPlatform.Dataverse.models import ExpandOption
401401

402402
# Expand related tasks with filtering and sorting
403403
for record in (client.query.builder("account")
@@ -614,12 +614,14 @@ 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.relationship import (
617+
from PowerPlatform.Dataverse.models import (
618+
CascadeConfiguration,
619+
Label,
620+
LocalizedLabel,
618621
LookupAttributeMetadata,
619-
OneToManyRelationshipMetadata,
620622
ManyToManyRelationshipMetadata,
623+
OneToManyRelationshipMetadata,
621624
)
622-
from PowerPlatform.Dataverse.models.labels import Label, LocalizedLabel
623625

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

822824
```python
823825
from PowerPlatform.Dataverse.client import DataverseClient
824-
from PowerPlatform.Dataverse.core.errors import HttpError, ValidationError
826+
from PowerPlatform.Dataverse.core import HttpError, ValidationError
825827

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

863865
```python
864866
from PowerPlatform.Dataverse.client import DataverseClient
865-
from PowerPlatform.Dataverse.core.config import DataverseConfig
866-
from PowerPlatform.Dataverse.core.log_config import LogConfig
867+
from PowerPlatform.Dataverse.core import DataverseConfig, LogConfig
867868

868869
log_cfg = LogConfig(
869870
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.upsert import UpsertItem
26+
from PowerPlatform.Dataverse.models import UpsertItem
2727
from azure.identity import InteractiveBrowserCredential # type: ignore
2828

2929
# --- Config ---

0 commit comments

Comments
 (0)