From ca87dfc680004ed57656232a69d512581210caf7 Mon Sep 17 00:00:00 2001 From: Ephraim Anierobi Date: Thu, 11 Dec 2025 15:14:09 +0100 Subject: [PATCH] Update Python Client to 3.1.4rc1 --- CHANGELOG.md | 7 + airflow_client/client/__init__.py | 2 +- airflow_client/client/api/login_api.py | 268 ------------------------- airflow_client/client/api_client.py | 2 +- airflow_client/client/configuration.py | 2 +- docs/LoginApi.md | 70 ------- pyproject.toml | 9 +- spec/v2.yaml | 32 --- test/test_login_api.py | 7 - version.txt | 2 +- 10 files changed, 18 insertions(+), 383 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0d7a18a..095211f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ under the License. --> +# v3.1.4 + +## Bug Fixes: + + - Update refresh token flow ([#55506](https://github.com/apache/airflow/pull/55506)) + - Patch pools should have an optional description ([#58066](https://github.com/apache/airflow/pull/58066)) + # v3.1.3 ## New Features: diff --git a/airflow_client/client/__init__.py b/airflow_client/client/__init__.py index 25c3d1a9..b47b50a3 100644 --- a/airflow_client/client/__init__.py +++ b/airflow_client/client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "3.1.3" +__version__ = "3.1.4" # import apis into sdk package from airflow_client.client.api.asset_api import AssetApi diff --git a/airflow_client/client/api/login_api.py b/airflow_client/client/api/login_api.py index 80fc67e0..21ad0441 100644 --- a/airflow_client/client/api/login_api.py +++ b/airflow_client/client/api/login_api.py @@ -551,271 +551,3 @@ def _logout_serialize( ) - - - @validate_call - def refresh( - self, - next: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: - """Refresh - - Refresh the authentication token. - - :param next: - :type next: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._refresh_serialize( - next=next, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '307': "HTTPExceptionResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def refresh_with_http_info( - self, - next: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: - """Refresh - - Refresh the authentication token. - - :param next: - :type next: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._refresh_serialize( - next=next, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '307': "HTTPExceptionResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def refresh_without_preload_content( - self, - next: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Refresh - - Refresh the authentication token. - - :param next: - :type next: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._refresh_serialize( - next=next, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '307': "HTTPExceptionResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _refresh_serialize( - self, - next, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if next is not None: - - _query_params.append(('next', next)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v2/auth/refresh', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/airflow_client/client/api_client.py b/airflow_client/client/api_client.py index 777d3387..a6404fb5 100644 --- a/airflow_client/client/api_client.py +++ b/airflow_client/client/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/3.1.3/python' + self.user_agent = 'OpenAPI-Generator/3.1.4/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/airflow_client/client/configuration.py b/airflow_client/client/configuration.py index 74ddce94..c815c17d 100644 --- a/airflow_client/client/configuration.py +++ b/airflow_client/client/configuration.py @@ -518,7 +518,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2\n"\ - "SDK Package Version: 3.1.3".\ + "SDK Package Version: 3.1.4".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/docs/LoginApi.md b/docs/LoginApi.md index 196f047a..1f6b9b42 100644 --- a/docs/LoginApi.md +++ b/docs/LoginApi.md @@ -6,7 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**login**](LoginApi.md#login) | **GET** /api/v2/auth/login | Login [**logout**](LoginApi.md#logout) | **GET** /api/v2/auth/logout | Logout -[**refresh**](LoginApi.md#refresh) | **GET** /api/v2/auth/refresh | Refresh # **login** @@ -142,72 +141,3 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **refresh** -> object refresh(next=next) - -Refresh - -Refresh the authentication token. - -### Example - - -```python -import airflow_client.client -from airflow_client.client.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = airflow_client.client.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -with airflow_client.client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = airflow_client.client.LoginApi(api_client) - next = 'next_example' # str | (optional) - - try: - # Refresh - api_response = api_instance.refresh(next=next) - print("The response of LoginApi->refresh:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling LoginApi->refresh: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **next** | **str**| | [optional] - -### Return type - -**object** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**307** | Temporary Redirect | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/pyproject.toml b/pyproject.toml index a7a22811..59593b1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,9 +102,14 @@ include = [ "/airflow_client", ] -[tool.pytest.ini_options] +[tool.pytest] # make sure that pytest.ini is not read from pyproject.toml in paraent directories -addopts = "--color=yes --cov-config=pyproject.toml --cov=airflow_client" +addopts = [ + "--color=yes", + "--cov-config=pyproject.toml", + "--cov=airflow_client", +] + norecursedirs = [ ] log_level = "INFO" diff --git a/spec/v2.yaml b/spec/v2.yaml index 45d7209d..53702b1a 100644 --- a/spec/v2.yaml +++ b/spec/v2.yaml @@ -4466,38 +4466,6 @@ paths: summary: Logout tags: - Login - /api/v2/auth/refresh: - get: - description: Refresh the authentication token. - operationId: refresh - parameters: - - in: query - name: next - required: false - schema: - nullable: true - type: string - responses: - '200': - content: - application/json: - schema: {} - description: Successful Response - '307': - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPExceptionResponse' - description: Temporary Redirect - '422': - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - description: Validation Error - summary: Refresh - tags: - - Login /api/v2/backfills: get: operationId: list_backfills diff --git a/test/test_login_api.py b/test/test_login_api.py index 007e38c7..d52ea087 100644 --- a/test/test_login_api.py +++ b/test/test_login_api.py @@ -40,13 +40,6 @@ def test_logout(self) -> None: """ pass - def test_refresh(self) -> None: - """Test case for refresh - - Refresh - """ - pass - if __name__ == '__main__': unittest.main() diff --git a/version.txt b/version.txt index ff365e06..0aec50e6 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.1.3 +3.1.4