Skip to content

Commit 3c72bd0

Browse files
committed
fix(client): correct name of write method
1 parent 5abe9a1 commit 3c72bd0

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

openfga_sdk/client/openfga_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ async def _write_with_transaction(self, body: ClientWriteRequest, options: dict[
420420
i, True, None) for i in body.deletes]
421421
return ClientWriteResponse(writes=writes_response, deletes=deletes_response)
422422

423-
async def writes(self, body: ClientWriteRequest, options: dict[str, str]):
423+
async def write(self, body: ClientWriteRequest, options: dict[str, str]):
424424
"""
425425
Write or deletes tuples
426426
:param body - the write request
@@ -458,7 +458,7 @@ async def write_tuples(self, body: List[ClientTuple], options: dict[str, str]):
458458
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
459459
"""
460460
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "WriteTuples")
461-
result = await self.writes(ClientWriteRequest(body, None), options)
461+
result = await self.write(ClientWriteRequest(body, None), options)
462462
return result
463463

464464
async def delete_tuples(self, body: List[ClientTuple], options: dict[str, str]):
@@ -471,7 +471,7 @@ async def delete_tuples(self, body: List[ClientTuple], options: dict[str, str]):
471471
:param retryParams.minWaitInMs(options) - Override the minimum wait before a retry is initiated
472472
"""
473473
options = set_heading_if_not_set(options, CLIENT_METHOD_HEADER, "DeleteTuples")
474-
result = await self.writes(ClientWriteRequest(None, body), options)
474+
result = await self.write(ClientWriteRequest(None, body), options)
475475
return result
476476

477477
#######################

test/test_openfga_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ async def test_write(self, mock_request):
757757
)
758758
],
759759
)
760-
await api_client.writes(
760+
await api_client.write(
761761
body,
762762
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J"}
763763
)
@@ -794,7 +794,7 @@ async def test_delete(self, mock_request):
794794
)
795795
],
796796
)
797-
await api_client.writes(
797+
await api_client.write(
798798
body,
799799
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J"}
800800
)
@@ -847,7 +847,7 @@ async def test_write_batch(self, mock_request):
847847
)
848848
transaction = WriteTransaction(
849849
disabled=True, max_per_chunk=1, max_parallel_requests=10)
850-
response = await api_client.writes(
850+
response = await api_client.write(
851851
body,
852852
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
853853
"transaction": transaction}
@@ -961,7 +961,7 @@ async def test_write_batch_min_parallel(self, mock_request):
961961
],
962962
)
963963
transaction = WriteTransaction(disabled=True, max_per_chunk=1, max_parallel_requests=1)
964-
response = await api_client.writes(
964+
response = await api_client.write(
965965
body,
966966
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
967967
"transaction": transaction}
@@ -1074,7 +1074,7 @@ async def test_write_batch_larger_chunk(self, mock_request):
10741074
],
10751075
)
10761076
transaction = WriteTransaction(disabled=True, max_per_chunk=2, max_parallel_requests=2)
1077-
response = await api_client.writes(
1077+
response = await api_client.write(
10781078
body,
10791079
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
10801080
"transaction": transaction}
@@ -1185,7 +1185,7 @@ async def test_write_batch_failed(self, mock_request):
11851185
)
11861186
transaction = WriteTransaction(
11871187
disabled=True, max_per_chunk=1, max_parallel_requests=10)
1188-
response = await api_client.writes(
1188+
response = await api_client.write(
11891189
body,
11901190
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
11911191
"transaction": transaction}
@@ -1289,7 +1289,7 @@ async def test_delete_batch(self, mock_request):
12891289
)
12901290
transaction = WriteTransaction(
12911291
disabled=True, max_per_chunk=1, max_parallel_requests=10)
1292-
await api_client.writes(
1292+
await api_client.write(
12931293
body,
12941294
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
12951295
"transaction": transaction}
@@ -1425,7 +1425,7 @@ async def test_write_batch_unauthorized(self, mock_request):
14251425
)
14261426
transaction = WriteTransaction(
14271427
disabled=True, max_per_chunk=1, max_parallel_requests=10)
1428-
await api_client.writes(
1428+
await api_client.write(
14291429
body,
14301430
options={"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
14311431
"transaction": transaction}

0 commit comments

Comments
 (0)