Skip to content

Commit 6135882

Browse files
SoulPancakerhamzeh
andauthored
fix: apply suggestions from code review
Co-authored-by: Raghd Hamzeh <raghd.hamzeh@auth0.com>
1 parent d25b2d3 commit 6135882

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Changelog
22

33
## [Unreleased](https://github.com/openfga/python-sdk/compare/v0.9.7...HEAD)
4-
- feat: The SDK supports OpenFGA v1.10.0+ conflict options:
4+
- feat: add support for conflict options for Write operations: (#235)
5+
The client now supports setting `ConflictOptions` on `ClientWriteOptions` to control behavior when writing duplicate tuples or deleting non-existent tuples. This feature requires OpenFGA server [v1.10.0](https://github.com/openfga/openfga/releases/tag/v1.10.0) or later.
6+
See [Conflict Options for Write Operations](./README.md#conflict-options-for-write-operations) for more.
57
- `on_duplicate` for handling duplicate tuple writes (ERROR or IGNORE)
68
- `on_missing` for handling deletes of non-existent tuples (ERROR or IGNORE)
79
- docs: added documentation for write conflict options in README

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,9 @@ body = ClientWriteRequest(
748748
response = await fga_client.write(body, options)
749749
```
750750

751-
###### Conflict Options
751+
###### Conflict Options for Write Operations
752752

753-
OpenFGA v1.10.0 introduced support for write conflict options to handle duplicate writes and missing deletes gracefully. These options help avoid unnecessary error handling logic in client code.
753+
With OpenFGA [v1.10.0](https://github.com/openfga/openfga/releases/tag/v1.10.0) and later, support for write conflict options to handle duplicate writes and missing deletes gracefully has been added.
754754

755755
**Available Options:**
756756

@@ -778,7 +778,8 @@ OpenFGA v1.10.0 introduced support for write conflict options to handle duplicat
778778
options = {
779779
"authorization_model_id": "01GXSA8YR785C4FYS3C0RTG7B1",
780780
"conflict": ConflictOptions(
781-
on_duplicate_writes=ClientWriteRequestOnDuplicateWrites.IGNORE
781+
on_duplicate_writes=ClientWriteRequestOnDuplicateWrites.IGNORE, // or ERROR to retain default behaviour
782+
on_missing_deletes=ClientWriteRequestOnMissingDeletes.IGNORE // or ERROR to retain default behaviour
782783
)
783784
}
784785

0 commit comments

Comments
 (0)