Skip to content

Commit f200d12

Browse files
committed
Remove redundant fga_client.close in python
fga_client.close() is handled by the context manager so it isn't needed, as discussed in openfga/python-sdk#191
1 parent 2f71825 commit f200d12

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

config/clients/python/template/README_initializing.mustache

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ async def main():
1717
# Enter a context with an instance of the OpenFgaClient
1818
async with OpenFgaClient(configuration) as fga_client:
1919
api_response = await fga_client.read_authorization_models()
20-
await fga_client.close()
21-
return api_response
20+
return api_response
2221
```
2322

2423
#### API Token
@@ -43,8 +42,7 @@ async def main():
4342
# Enter a context with an instance of the OpenFgaClient
4443
async with OpenFgaClient(configuration) as fga_client:
4544
api_response = await fga_client.read_authorization_models()
46-
await fga_client.close()
47-
return api_response
45+
return api_response
4846
```
4947

5048
#### Client Credentials
@@ -72,8 +70,7 @@ async def main():
7270
# Enter a context with an instance of the OpenFgaClient
7371
async with OpenFgaClient(configuration) as fga_client:
7472
api_response = await fga_client.read_authorization_models()
75-
await fga_client.close()
76-
return api_response
73+
return api_response
7774
```
7875

7976
#### Synchronous Client
@@ -96,5 +93,5 @@ def main():
9693
# Enter a context with an instance of the OpenFgaClient
9794
with OpenFgaClient(configuration) as fga_client:
9895
api_response = fga_client.read_authorization_models()
99-
return api_response
96+
return api_response
10097
```

0 commit comments

Comments
 (0)