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
Resolve import conflict in client.py: keep both metadata imports and
operation namespace imports.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/dataverse-sdk-dev/SKILL.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This skill provides guidance for developers working on the PowerPlatform Dataver
13
13
14
14
### API Design
15
15
16
-
1.**All public methods in client.py** - Public API methods must be in client.py
16
+
1.**Public API in operation namespaces** - New public methods go in the appropriate namespace module under `src/PowerPlatform/Dataverse/operations/` (`records.py`, `query.py`, `tables.py`). The `client.py` file exposes these via namespace properties (`client.records`, `client.query`, `client.tables`)
17
17
2.**Every public method needs README example** - Public API methods must have examples in README.md
18
18
3.**Reuse existing APIs** - Always check if an existing method can be used before making direct Web API calls
19
19
4.**Update documentation** when adding features - Keep README and SKILL files (both copies) in sync
@@ -25,5 +25,5 @@ This skill provides guidance for developers working on the PowerPlatform Dataver
25
25
7.**Standardize output format** - Use `[INFO]`, `[WARN]`, `[ERR]`, `[OK]` prefixes for console output
26
26
8.**No noqa comments** - Do not add `# noqa: BLE001` or similar linter suppression comments
27
27
9.**Document public APIs** - Add Sphinx-style docstrings with examples for public methods
28
-
10.**Define __all__ in module files, not __init__.py** - Use `__all__` to control exports in the actual module file (e.g., errors.py), not in`__init__.py`.
29
-
11.**Run black before committing** - Always run `python -m black <changed files>` before committing. CI will reject unformatted code. Config is in `pyproject.toml` under `[tool.black]`.
28
+
10.**Define __all__ in module files** - Each module declares its own exports via `__all__`(e.g., `errors.py` defines `__all__ = ["HttpError", ...]`). Package`__init__.py` files should not re-export or redefine another module's `__all__`; they use `__all__ = []` to indicate no star-import exports.
29
+
11.**Run black before committing** - Always run `python -m black <changed files>` before committing. CI will reject unformatted code. Config is in `pyproject.toml` under `[tool.black]`.
Copy file name to clipboardExpand all lines: README.md
+34-36Lines changed: 34 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,9 +111,10 @@ The SDK provides a simple, pythonic interface for Dataverse operations:
111
111
112
112
| Concept | Description |
113
113
|---------|-------------|
114
-
|**DataverseClient**| Main entry point for all operations with environment connection |
114
+
|**DataverseClient**| Main entry point; provides `records`, `query`, and `tables` namespaces |
115
+
|**Namespaces**| Operations are organized into `client.records` (CRUD), `client.query` (queries), and `client.tables` (metadata) |
115
116
|**Records**| Dataverse records represented as Python dictionaries with column schema names |
116
-
|**Schema names**| Use table schema names (`"account"`, `"new_MyTestTable"`) and column schema names (`"name"`, `"new_MyTestColumn"`). See: [Table definitions in Microsoft Dataverse](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/entity-metadata)|
117
+
|**Schema names**| Use table schema names (`"account"`, `"new_MyTestTable"`) and column schema names (`"name"`, `"new_MyTestColumn"`). See: [Table definitions in Microsoft Dataverse](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/entity-metadata)|
117
118
|**Bulk Operations**| Efficient bulk processing for multiple records with automatic optimization |
118
119
|**Paging**| Automatic handling of large result sets with iterators |
119
120
|**Structured Errors**| Detailed exception hierarchy with retry guidance and diagnostic information |
> **Important**: All custom column names must include the customization prefix value (e.g., `"new_"`).
@@ -376,7 +374,7 @@ from PowerPlatform.Dataverse.client import DataverseClient
376
374
from PowerPlatform.Dataverse.core.errors import HttpError, ValidationError
377
375
378
376
try:
379
-
client.get("account", "invalid-id")
377
+
client.records.get("account", "invalid-id")
380
378
except HttpError as e:
381
379
print(f"HTTP {e.status_code}: {e.message}")
382
380
print(f"Error code: {e.code}")
@@ -400,7 +398,7 @@ For optimal performance in production environments:
400
398
401
399
| Best Practice | Description |
402
400
|---------------|-------------|
403
-
|**Bulk Operations**| Pass lists to `create()`, `update()` for automatic bulk processing, for `delete()`, set `use_bulk_delete` when passing lists to use bulk operation |
401
+
|**Bulk Operations**| Pass lists to `records.create()`, `records.update()` for automatic bulk processing, for `records.delete()`, set `use_bulk_delete` when passing lists to use bulk operation |
404
402
|**Select Fields**| Specify `select` parameter to limit returned columns and reduce payload size |
405
403
|**Page Size Control**| Use `top` and `page_size` parameters to control memory usage |
406
404
|**Connection Reuse**| Reuse `DataverseClient` instances across operations |
@@ -431,7 +429,7 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio
431
429
432
430
When contributing new features to this SDK, please follow these guidelines:
433
431
434
-
1.**All public methods in client.py** - Public API methods must be defined in [client.py](src/PowerPlatform/Dataverse/client.py)
432
+
1.**Public API in operation namespaces** - New public methods go in the appropriate namespace module under [operations/](src/PowerPlatform/Dataverse/operations/)
435
433
2.**Add README example for public methods** - Add usage examples to this README for public API methods
436
434
3.**Document public APIs** - Include Sphinx-style docstrings with parameter descriptions and examples for all public methods
437
435
4.**Update documentation** when adding features - Keep README and SKILL files (note that each skill has 2 copies) in sync
0 commit comments