Added Samples for Feed Range APIs#45166
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds new Azure Cosmos DB Python SDK documentation and runnable samples demonstrating how to use feed range APIs for scoped operations (queries and change feed) and parallel processing patterns.
Changes:
- Added new sync and async samples covering core feed range scenarios (read/derive/compare feed ranges, feed-range-scoped queries, and change feed).
- Added new conceptual documentation page
FeedRanges.mddescribing feed ranges, when to use them, and the relevant APIs. - Updated the samples README to reference the new feed range sample.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/samples/feed_range_management.py | New sync sample demonstrating feed range APIs and patterns. |
| sdk/cosmos/azure-cosmos/samples/feed_range_management_async.py | New async sample demonstrating feed range APIs and parallel processing with asyncio.gather(). |
| sdk/cosmos/azure-cosmos/samples/README.md | Adds an entry pointing to the new feed range sample. |
| sdk/cosmos/azure-cosmos/docs/FeedRanges.md | New conceptual + API reference doc for feed ranges (sync/async). |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
simorenoh
left a comment
There was a problem hiding this comment.
Just a couple comments, looks good otherwise - thanks!
|
Hi @andrewmathew1. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Description
Adds comprehensive samples and documentation for the feed range APIs. Feed ranges enable sub-container-level operations such as parallel query processing, scoped change feed consumption, and workload distribution across workers.
What's included
New sample files:
Both samples demonstrate all public feed range APIs across 7 scenarios:
Reading feed ranges from a container (read_feed_ranges)
Converting a partition key to a feed range (feed_range_from_partition_key)
Checking feed range subset relationships (is_feed_range_subset)
Querying items scoped to individual feed ranges (query_items with feed_range)
Comparing feed range queries with partition key queries
Consuming change feed scoped to a feed range (query_items_change_feed with feed_range)
Parallel change feed processing by distributing feed ranges across workers
New documentation:
FeedRanges.md — Conceptual guide covering what feed ranges are, when to use them, API reference with sync/async code snippets, feed ranges vs partition keys comparison, and important considerations (opaque values, serialization, partition splits, mutual exclusivity)
Updated:
README.md — Added entry for the new feed range samples