Skip to content

Commit ca82b8c

Browse files
committed
naming / doc updates
1 parent d92ecf3 commit ca82b8c

5 files changed

Lines changed: 234 additions & 196 deletions

File tree

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ The SDK provides a simple, pythonic interface for Dataverse operations:
104104
| **Bulk Operations** | Efficient bulk processing for multiple records with automatic optimization |
105105
| **Paging** | Automatic handling of large result sets with iterators |
106106
| **Structured Errors** | Detailed exception hierarchy with retry guidance and diagnostic information |
107-
| **Publisher Prefixes** | Custom columns require publisher prefix (e.g., `"new_Title"` not `"Title"`) |
107+
| **Customization prefix values** | Custom tables and columns require a customization prefix values to be included for all operations (e.g., `"new_Title"`, not `"Title"`). See: [Table definitions in Microsoft Dataverse](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/entity-metadata) |
108108

109109
## Examples
110110

@@ -176,21 +176,39 @@ for record in results:
176176
print(record["name"])
177177

178178
# OData query with paging
179+
# Note: filter and expand parameters require exact casing
179180
pages = client.get(
180181
"account",
181-
select=["accountid", "name"],
182-
filter="statecode eq 0",
182+
select=["accountid", "name"], # select is case-insensitive (automatically lowercased)
183+
filter="statecode eq 0", # filter must use lowercase logical names (not transformed)
183184
top=100
184185
)
185186
for page in pages:
186187
for record in page:
187188
print(record["name"])
189+
190+
# Query with navigation property expansion (case-sensitive!)
191+
pages = client.get(
192+
"account",
193+
select=["name"],
194+
expand=["primarycontactid"], # Navigation property names are case-sensitive
195+
filter="statecode eq 0" # Column names must be lowercase logical names
196+
)
197+
for page in pages:
198+
for account in page:
199+
contact = account.get("primarycontactid", {})
200+
print(f"{account['name']} - Contact: {contact.get('fullname', 'N/A')}")
188201
```
189202

203+
> **Important**: When using `filter` and `expand` parameters:
204+
> - **`filter`**: Column names must use exact lowercase logical names (e.g., `"statecode eq 0"`, not `"StateCode eq 0"`)
205+
> - **`expand`**: Navigation property names are case-sensitive and must match the exact server names
206+
> - **`select`** and **`orderby`**: Case-insensitive; automatically converted to lowercase
207+
190208
### Table management
191209

192210
```python
193-
# Create a custom table with publisher-prefixed columns
211+
# Create a custom table, including the customization prefix value in the schema names for the table and columns.
194212
table_info = client.create_table("new_Product", {
195213
"new_Code": "string",
196214
"new_Price": "decimal",
@@ -199,16 +217,16 @@ table_info = client.create_table("new_Product", {
199217

200218
# Create with custom primary column name and solution assignment
201219
table_info = client.create_table(
202-
tablename="new_Product",
220+
table_schema_name="new_Product",
203221
schema={
204222
"new_Code": "string",
205223
"new_Price": "decimal"
206224
},
207225
solution_unique_name="MyPublisher", # Optional: add to specific solution
208-
primary_column_name="new_ProductName" # Optional: custom primary column (default is "{prefix}_Name")
226+
primary_column_schema_name="new_ProductName" # Optional: custom primary column (default is "{customization prefix value}_Name")
209227
)
210228

211-
# Add columns to existing table (columns must include publisher prefix)
229+
# Add columns to existing table (columns must include customization prefix value)
212230
client.create_columns("new_Product", {"new_Category": "string"})
213231

214232
# Remove columns
@@ -218,7 +236,7 @@ client.delete_columns("new_Product", ["new_Category"])
218236
client.delete_table("new_Product")
219237
```
220238

221-
> **Important**: All custom column names must include the publisher prefix (e.g., `"new_"`).
239+
> **Important**: All custom column names must include the customization prefix value (e.g., `"new_"`).
222240
> This ensures explicit, predictable naming and aligns with Dataverse metadata requirements.
223241
224242
### File operations

examples/advanced/file_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def backoff(op, *, delays=(0,2,5,10), retry_status=(400,403,404,409,412,429,500,
166166

167167
# --------------------------- Table ensure ---------------------------
168168
TABLE_SCHEMA_NAME = "new_FileSample"
169-
# If user wants new publisher prefix / naming, adjust above.
169+
# If user wants new customization prefix value / naming, adjust above.
170170

171171
def ensure_table():
172172
# Check by schema

examples/basic/functional_testing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,24 @@ def ensure_test_table(client: DataverseClient) -> Dict[str, Any]:
7878
print("\n📋 Test Table Setup")
7979
print("=" * 50)
8080

81-
tablename = "test_TestSDKFunctionality"
81+
table_schema_name = "test_TestSDKFunctionality"
8282

8383
try:
8484
# Check if table already exists
85-
existing_table = client.get_table_info(tablename)
85+
existing_table = client.get_table_info(table_schema_name)
8686
if existing_table:
87-
print(f"✅ Test table '{tablename}' already exists")
87+
print(f"✅ Test table '{table_schema_name}' already exists")
8888
return existing_table
8989

9090
except Exception:
91-
print(f"📝 Table '{tablename}' not found, creating...")
91+
print(f"📝 Table '{table_schema_name}' not found, creating...")
9292

9393
try:
9494
print("🔨 Creating new test table...")
9595
# Create the test table with various field types
9696
table_info = client.create_table(
97-
tablename,
98-
primary_column_name="test_name",
97+
table_schema_name,
98+
primary_column_schema_name="test_name",
9999
schema=
100100
{
101101
"test_description": "string", # Description field

0 commit comments

Comments
 (0)