Skip to content

Commit 5a24cb4

Browse files
committed
fixed tab issue causing build failure
1 parent 20625cf commit 5a24cb4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

articles/cosmos-db/hierarchical-partition-keys.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,20 @@ const partitionKey: PartitionKey = new PartitionKeyBuilder()
395395
// Create the item in the container
396396
const { resource: document } = await container.items.create(item, partitionKey);
397397
```
398+
399+
#### [Python SDK](#tab/python)
400+
401+
For python, just make sure that values for all the fields in the partition key path are specified in the item definition.
402+
403+
```python
404+
# specify values for all fields on partition key path
405+
item_definition = {'id': 'f7da01b0-090b-41d2-8416-dacae09fbb4a',
406+
'tenantId': 'Microsoft',
407+
'userId': '8411f20f-be3e-416a-a3e7-dcd5a3c1f28b',
408+
'sessionId': '0000-11-0000-1111'}
409+
410+
item = container.create_item(body=item_definition)
411+
```
398412
---
399413

400414
### Perform a key/value lookup (point read) of an item

0 commit comments

Comments
 (0)