Fix idempotent writes and deletes: on_duplicate and on_missing should not be stored on ClientWriteRequest body#6
Closed
Copilot wants to merge 4 commits intofeat/support-write-conflict-optionsfrom
Conversation
…ed on body Co-authored-by: SoulPancake <70265851+SoulPancake@users.noreply.github.com>
Co-authored-by: SoulPancake <70265851+SoulPancake@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix idempotent writes and deletes handling
Fix idempotent writes and deletes: on_duplicate and on_missing should not be stored on ClientWriteRequest body
Oct 16, 2025
Owner
|
@copilot The tests are failing now |
…ing values Co-authored-by: SoulPancake <70265851+SoulPancake@users.noreply.github.com>
Author
Fixed all failing tests! The tests were expecting the API body to NOT include All 175 tests now pass ✅ (commit: 7dcc9b5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix idempotent writes and deletes handling for on_duplicate and on_missing
The issue was that
on_duplicateandon_missingparameters were incorrectly stored on theClientWriteRequestbody when they should only be passed through options and set directly on the API model's writes/deletes objects.Changes made:
on_duplicateandon_missingfromClientWriteRequest.__init__and their properties/setterswrites_tuple_keysanddeletes_tuple_keysto be methods that accept these values as parametersopenfga_sdk/client/client.py) to pass conflict options when calling the methodsopenfga_sdk/sync/client/client.py) similarlyTechnical Details:
on_duplicateandon_missingare now passed as parameters towrites_tuple_keys()anddeletes_tuple_keys()methodsFiles Changed:
openfga_sdk/client/models/write_request.py- Core model changesopenfga_sdk/client/client.py- Async client updatesopenfga_sdk/sync/client/client.py- Sync client updatestest/client/client_test.py- Test expectations updatedtest/sync/client/client_test.py- Test expectations updatedOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.