Skip to content

Conversation

@andrewmathew1
Copy link
Contributor

@andrewmathew1 andrewmathew1 commented Feb 12, 2026

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:

  • feed_range_management.py — Sync sample
  • feed_range_management_async.py — Async sample with asyncio.gather() for concurrent processing

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md describing 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).

@andrewmathew1 andrewmathew1 changed the title Added Aamples for Feed Range APIs Added Samples for Feed Range APIs Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Cosmos] add comprehensive samples and documentation for feed range APIs and usage

1 participant