Skip to content

Commit 4531c96

Browse files
Merge pull request #270938 from AbhinavTrips/main
Adding Python SDK support for priority based throttling
2 parents 197be6f + 32ca065 commit 4531c96

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

articles/cosmos-db/priority-based-execution.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ To get started using priority-based execution, navigate to the **Features** page
4343
- Java v4: [v4.45.0](https://mvnrepository.com/artifact/com.azure/azure-cosmos/4.45.0) or later
4444
- Spark 3.2: [v4.19.0](https://central.sonatype.com/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-2_2-12/4.19.0) or later
4545
- JavaScript v4: [v4.0.0](https://www.npmjs.com/package/@azure/cosmos) or later
46+
- Python 4.6.0: [v4.6.0](https://pypi.org/project/azure-cosmos/4.6.0/) or later
4647

4748
## Code samples
4849

@@ -102,8 +103,20 @@ container.createItem(family, new PartitionKey(family.getLastName()), requestOpti
102103
}).subscribe();
103104

104105
```
106+
#### [Python SDK](#tab/python)
107+
108+
Priority-based execution feature is a preview feature available in Python SDK v4.6.0 or later. It should be enabled at the account level before using it in the Python SDK.
109+
The request priority can be specified as "Low" or "High" as below:
110+
111+
```python
112+
item1_read = container.read_item("item1", "pk1", priority="High")
113+
item2_read = container.read_item("item2", "pk2", priority="Low")
114+
query = list(container.query_items("Select * from c", partition_key="pk1", priority="High"))
115+
```
116+
105117
---
106118

119+
107120
## Monitoring Priority-based execution
108121

109122
You can monitor the behavior of requests with low and high priority using Azure monitor metrics in Azure portal.

0 commit comments

Comments
 (0)