-
Notifications
You must be signed in to change notification settings - Fork 313
Add PatchDocument::condition
and builder method for it
#2969
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
Conversation
Thank you for your contribution @jprochazk! We will review the pull request and get back to you soon. |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
b58b4d7
to
f16d165
Compare
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.
Hey, if you'd like to undraft this, I think it's a good addition! I made one minor comment about the implementation, and it'll need at least one unit test to be added, then it'll be ready to go if you want to contribute it!
f16d165
to
a78eabc
Compare
Added a few tests for serialization and deserialization. Windows CI is failing, but it seems unrelated, as the same tests pass on Linux/MacOS. |
(I am still waiting for approval from my employer to sign the CLA. I assume there will be no problem with that, but it's pending) |
@microsoft-github-policy-service agree company="Rerun" |
The build failures are a known issue in |
/azp run rust - pullrequest |
Azure Pipelines successfully started running 1 pipeline(s). |
Rebase again. There was a bad PR that went into |
a78eabc
to
fac09f5
Compare
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.
Pull Request Overview
This PR adds conditional patch operation support to the PatchDocument
struct by introducing a condition
field and corresponding builder method. This enables users to apply patch operations conditionally based on SQL-like filter predicates, aligning with Azure Cosmos DB's conditional patch operation REST API.
- Added optional
condition
field toPatchDocument
struct with proper serialization handling - Implemented
with_condition
builder method for fluent API usage - Added comprehensive tests including serialization and real-world example validation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
sdk/cosmos/azure_data_cosmos/src/models/patch_operations.rs | Added condition field to PatchDocument , implemented with_condition builder method, and added tests for conditional patch functionality |
sdk/cosmos/azure_data_cosmos/examples/cosmos/patch.rs | Updated struct initialization to include the new condition field |
I forgot to ask you to update the CHANGELOG, but I'll do that in an upcoming PR (we're nearing a release and I need to modify that file anyway) |
Adds the ability to provide the
condition
for conditional patch operations. Related REST API docs here: