-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'change_feed_mode' to 'query_items_change_feed' API #38105
Add 'change_feed_mode' to 'query_items_change_feed' API #38105
Conversation
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_state.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_state.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_state.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_state.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
API change check APIView has identified API level changes in this PR and created following API reviews. |
sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_utils.py
Outdated
Show resolved
Hide resolved
This reverts commit 217dabc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me except for the comment in ChangeFeedStateV2
…llVersionsAndLatest' into users/allekim/feature/feedRangeAllVersionsAndLatest # Conflicts: # sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_state.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM-Thanks
Description
In this PR, we added support for
change_feed_mode
forquery_items_change_feed
API. For thechange_feed_mode
argument, users can use either string values(LatestVersion
orAllVersionsAndDeletes
) or Enum values(ChangeFeedMode.LATEST_VERSION
orChangeFeedMode.ALL_VERSIONS_AND_DELETES
). The Enum can be imported fromchange_feed_state.py
like the following:Currently the default value for the
change_feed_mode
isLATEST_VERSION
mode. If thechange_feed_mode
argument were not passed,query_items_change_feed
will useLATEST_VERSION
by default. This mode was the only mode supported before we added thechange_feed_mdoe
argument. Now users can choose either option by passingchange_feed_mode
ChangeFeedMode.LATEST_VERSION
With this mode, we return all items of the latest/current version from a container. Even if some items were updated after creation, it only returns the latest version of all created items from a specified point of time, which could be passed by the following arguments. (By default, the point in time will be
Now
):is_start_from_beginning
: Query all items created from the beginning of container creation. (is_start_from_beginning
andstart_time
are exclusive, and cannot be used together.)start_time
: Query items created from thestart time
. The start time can be [datetime, 'Now', or 'Beginning']. (is_start_from_beginning
andstart_time
are exclusive, and cannot be used together.)continuation
: Query all items created from acontinuation
token, which was stored from previous query run.example:
ChangeFeedMode.ALL_VERSIONS_AND_DELETES
With this option, we return all items of all versions including creates, updates, deletes. If an item was deleted , the deleted items will be included, and the metadata will specify that the item was deleted. Currently, we backend server only supports
continuation
token to specify the beginning time. Ifis_start_from_beginning
orstart_time
were used, exceptions will be risen with error message. Ifcontinuation
token was not passed, the point in time will be set toNow
.example:
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines