From 2be77a7e38ca08981a9bb4928a7e826015ee4e14 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Tue, 25 Mar 2025 09:48:11 -0500 Subject: [PATCH] release: v0.9.2 --- CHANGELOG.md | 7 ++++++- VERSION.txt | 2 +- example/example1/requirements.txt | 2 +- example/example1/setup.py | 2 +- openfga_sdk/__init__.py | 2 +- openfga_sdk/api_client.py | 2 +- openfga_sdk/oauth2.py | 2 +- openfga_sdk/sync/api_client.py | 2 +- openfga_sdk/sync/oauth2.py | 2 +- openfga_sdk/telemetry/metrics.py | 4 ++-- setup.py | 2 +- test/api/open_fga_api_test.py | 4 ++-- test/oauth2_test.py | 2 +- test/sync/oauth2_test.py | 2 +- test/sync/open_fga_api_test.py | 4 ++-- 15 files changed, 23 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23939f1f..c9a44c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog -## [Unreleased](https://github.com/openfga/python-sdk/compare/v0.9.1...HEAD) +## [Unreleased](https://github.com/openfga/python-sdk/compare/v0.9.2...HEAD) + +### [0.9.2](https://github.com/openfga/python-sdk/compare/v0.9.1...v0.9.2) (2025-03-25) + +- fix(telemetry): fixes for telemetry attributes and metrics tracking +- fix: REST client should not close after `stream` request ## v0.9.1 diff --git a/VERSION.txt b/VERSION.txt index f374f666..2003b639 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.9.1 +0.9.2 diff --git a/example/example1/requirements.txt b/example/example1/requirements.txt index eed47778..03e1fdc4 100644 --- a/example/example1/requirements.txt +++ b/example/example1/requirements.txt @@ -4,7 +4,7 @@ attrs >= 23.1.0 frozenlist >= 1.4.1 idna >= 3.6 multidict >= 6.0.4 -openfga-sdk >= 0.9.1 +openfga-sdk >= 0.9.2 python-dateutil >= 2.8.2 urllib3 >= 2.1.0 yarl >= 1.9.4 diff --git a/example/example1/setup.py b/example/example1/setup.py index 7fedda78..de4ef05e 100644 --- a/example/example1/setup.py +++ b/example/example1/setup.py @@ -15,7 +15,7 @@ NAME = "example1" VERSION = "0.0.1" -REQUIRES = ["openfga-sdk >= 0.9.1"] +REQUIRES = ["openfga-sdk >= 0.9.2"] setup( name=NAME, diff --git a/openfga_sdk/__init__.py b/openfga_sdk/__init__.py index cd477de0..5c47fb57 100644 --- a/openfga_sdk/__init__.py +++ b/openfga_sdk/__init__.py @@ -10,7 +10,7 @@ NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. """ -__version__ = "0.9.1" +__version__ = "0.9.2" from openfga_sdk.api.open_fga_api import OpenFgaApi from openfga_sdk.api_client import ApiClient diff --git a/openfga_sdk/api_client.py b/openfga_sdk/api_client.py index 7587d251..1a9d24ca 100644 --- a/openfga_sdk/api_client.py +++ b/openfga_sdk/api_client.py @@ -39,7 +39,7 @@ from openfga_sdk.telemetry.attributes import TelemetryAttribute, TelemetryAttributes -DEFAULT_USER_AGENT = "openfga-sdk python/0.9.1" +DEFAULT_USER_AGENT = "openfga-sdk python/0.9.2" def random_time(loop_count, min_wait_in_ms): diff --git a/openfga_sdk/oauth2.py b/openfga_sdk/oauth2.py index dffe7174..a6271489 100644 --- a/openfga_sdk/oauth2.py +++ b/openfga_sdk/oauth2.py @@ -83,7 +83,7 @@ async def _obtain_token(self, client): { "Accept": "application/json", "Content-Type": "application/x-www-form-urlencoded", - "User-Agent": "openfga-sdk (python) 0.9.1", + "User-Agent": "openfga-sdk (python) 0.9.2", } ) diff --git a/openfga_sdk/sync/api_client.py b/openfga_sdk/sync/api_client.py index 89b83fcf..9ae34f65 100644 --- a/openfga_sdk/sync/api_client.py +++ b/openfga_sdk/sync/api_client.py @@ -38,7 +38,7 @@ from openfga_sdk.telemetry.attributes import TelemetryAttribute, TelemetryAttributes -DEFAULT_USER_AGENT = "openfga-sdk python/0.9.1" +DEFAULT_USER_AGENT = "openfga-sdk python/0.9.2" def random_time(loop_count, min_wait_in_ms) -> float: diff --git a/openfga_sdk/sync/oauth2.py b/openfga_sdk/sync/oauth2.py index b61e9bdf..1b62e830 100644 --- a/openfga_sdk/sync/oauth2.py +++ b/openfga_sdk/sync/oauth2.py @@ -83,7 +83,7 @@ def _obtain_token(self, client): { "Accept": "application/json", "Content-Type": "application/x-www-form-urlencoded", - "User-Agent": "openfga-sdk (python) 0.9.1", + "User-Agent": "openfga-sdk (python) 0.9.2", } ) diff --git a/openfga_sdk/telemetry/metrics.py b/openfga_sdk/telemetry/metrics.py index c4f3fc84..fc1c7cf6 100644 --- a/openfga_sdk/telemetry/metrics.py +++ b/openfga_sdk/telemetry/metrics.py @@ -179,7 +179,7 @@ def requestDuration( if ( isinstance(configuration, TelemetryConfiguration) - and type(configuration.metrics) is TelemetryMetricsConfiguration + and isinstance(configuration.metrics, TelemetryMetricsConfiguration) and isinstance( configuration.metrics.fga_client_request_duration, TelemetryMetricConfiguration, @@ -228,7 +228,7 @@ def queryDuration( if ( isinstance(configuration, TelemetryConfiguration) - and isinstance(configuration.metrics, TelemetryMetricConfiguration) + and isinstance(configuration.metrics, TelemetryMetricsConfiguration) and isinstance( configuration.metrics.fga_client_query_duration, TelemetryMetricConfiguration, diff --git a/setup.py b/setup.py index e67f4cb0..305ecf47 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ NAME = "openfga-sdk" -VERSION = "0.9.1" +VERSION = "0.9.2" REQUIRES = [] diff --git a/test/api/open_fga_api_test.py b/test/api/open_fga_api_test.py index dac5f7a0..dc474dc2 100644 --- a/test/api/open_fga_api_test.py +++ b/test/api/open_fga_api_test.py @@ -1547,7 +1547,7 @@ async def test_check_api_token(self, mock_request): { "Accept": "application/json", "Content-Type": "application/json", - "User-Agent": "openfga-sdk python/0.9.1", + "User-Agent": "openfga-sdk python/0.9.2", "Authorization": "Bearer TOKEN1", } ) @@ -1601,7 +1601,7 @@ async def test_check_custom_header(self, mock_request): { "Accept": "application/json", "Content-Type": "application/json", - "User-Agent": "openfga-sdk python/0.9.1", + "User-Agent": "openfga-sdk python/0.9.2", "Custom Header": "custom value", } ) diff --git a/test/oauth2_test.py b/test/oauth2_test.py index 90251f08..e820f829 100644 --- a/test/oauth2_test.py +++ b/test/oauth2_test.py @@ -84,7 +84,7 @@ async def test_get_authentication_obtain_client_credentials(self, mock_request): { "Accept": "application/json", "Content-Type": "application/x-www-form-urlencoded", - "User-Agent": "openfga-sdk (python) 0.9.1", + "User-Agent": "openfga-sdk (python) 0.9.2", } ) mock_request.assert_called_once_with( diff --git a/test/sync/oauth2_test.py b/test/sync/oauth2_test.py index 82f7d367..8f9bf2aa 100644 --- a/test/sync/oauth2_test.py +++ b/test/sync/oauth2_test.py @@ -84,7 +84,7 @@ def test_get_authentication_obtain_client_credentials(self, mock_request): { "Accept": "application/json", "Content-Type": "application/x-www-form-urlencoded", - "User-Agent": "openfga-sdk (python) 0.9.1", + "User-Agent": "openfga-sdk (python) 0.9.2", } ) mock_request.assert_called_once_with( diff --git a/test/sync/open_fga_api_test.py b/test/sync/open_fga_api_test.py index fc1fc871..0827b09d 100644 --- a/test/sync/open_fga_api_test.py +++ b/test/sync/open_fga_api_test.py @@ -1547,7 +1547,7 @@ async def test_check_api_token(self, mock_request): { "Accept": "application/json", "Content-Type": "application/json", - "User-Agent": "openfga-sdk python/0.9.1", + "User-Agent": "openfga-sdk python/0.9.2", "Authorization": "Bearer TOKEN1", } ) @@ -1601,7 +1601,7 @@ async def test_check_custom_header(self, mock_request): { "Accept": "application/json", "Content-Type": "application/json", - "User-Agent": "openfga-sdk python/0.9.1", + "User-Agent": "openfga-sdk python/0.9.2", "Custom Header": "custom value", } )