feat: Cosmos DB Change Feed Mode Support#346
Conversation
- Added CosmosDBChangeFeedMode type supporting LatestVersion and AllVersionsAndDeletes modes - Updated CosmosDBConverter and CosmosDBTriggerConverter documentation - Exported CosmosDBChangeFeedMode from public API - Added 3 unit tests for change feed mode support - Updated version to 1.26.0
|
/azp run |
|
Commenter does not have sufficient privileges for PR 346 in repo Azure/azure-functions-python-library |
|
I am not familiar with E2E-test situation for this repo, but want to make sure the feature is validated either manually or by tests. A specific scenario to validate for is the incoming payload type when using |
| # then | ||
| self.assertTrue(is_exception_raised) | ||
|
|
||
| def test_cosmosdb_change_feed_mode_latest_version_support(self): |
There was a problem hiding this comment.
Can you add tests for the decorator changes as well? You can add them under tests/decorators/test_cosmosdb.py - for reference, you can look at the Blob decorator tests with the source param (lines 11 - 69):
|
For Jacob's comment, our Cosmos DB E2E tests are defined here, and we use the Cosmos DB emulator. If this feature is supported in the emulator, you can create a PR to the python worker repo with the new function apps & tests. If the feature is not supported, we can create a follow-up task to update the Cosmos tests when the emulators have this change. Please let me know if you have any questions for testing! |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@hallvictoria I don't think it is supported in the emulator 😞. That has been the challenge with all my E2E tests also. I manually test with a real CosmosDB then disable the tests before checking in. |
Summary
Updated Python Azure Functions library to support Cosmos DB change feed modes (
LatestVersionandAllVersionsAndDeletes), aligning with Azure WebJobs Extensions upstream implementation.Changes
CosmosDBChangeFeedModetype hint in_cosmosdb.pysupporting 'LatestVersion' | 'AllVersionsAndDeletes'CosmosDBConverterandCosmosDBTriggerConverterclass docstrings to document change feed mode behaviorCosmosDBChangeFeedModetype from main__init__.pyfor public consumptiontest_cosmosdb_change_feed_mode_latest_version_support: Validates LatestVersion modetest_cosmosdb_change_feed_mode_all_versions_and_deletes_support: Validates AllVersionsAndDeletes modetest_cosmosdb_change_feed_mode_type_available: Verifies type availability in public APIFiles Modified
azure/functions/_cosmosdb.py: AddedCosmosDBChangeFeedModetypeazure/functions/cosmosdb.py: Updated documentation, exported typeazure/functions/__init__.py: Exported and documentedCosmosDBChangeFeedModetests/test_cosmosdb.py: Added change feed mode testsAlignment
This change mirrors the Node.js library v4.16.1 Cosmos DB updates, ensuring consistent change feed support across both runtimes.