From 25058bcdc9cfc70711c709bf452fb8a9819a571d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:45:47 +0000 Subject: [PATCH 1/3] chore(readme): fix version rendering on pypi --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f9395885..c93e6fca 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Finch Python API library -[![PyPI version]()](https://pypi.org/project/finch-api/) + +[![PyPI version](https://img.shields.io/pypi/v/finch-api.svg?label=pypi%20(stable))](https://pypi.org/project/finch-api/) The Finch Python library provides convenient access to the Finch REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, From f1fd42e0dd7b4818b3d7fb73e2907b65fbc3889a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:14:17 +0000 Subject: [PATCH 2/3] fix(client): don't send Content-Type header on GET requests --- pyproject.toml | 2 +- src/finch/_base_client.py | 11 +++++++++-- tests/test_client.py | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b29b5ef9..838022ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/Finch-API/finch-api-python" Repository = "https://github.com/Finch-API/finch-api-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true diff --git a/src/finch/_base_client.py b/src/finch/_base_client.py index 1caaa8d7..a904662b 100644 --- a/src/finch/_base_client.py +++ b/src/finch/_base_client.py @@ -530,6 +530,15 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -541,8 +550,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) diff --git a/tests/test_client.py b/tests/test_client.py index 24a87f3f..a32d2944 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -473,7 +473,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, client: Finch) -> None: request = client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -1312,7 +1312,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, async_client: AsyncFinch) -> None: request = async_client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, From 9c2ba38a8e9af3be41b19f906738d27ff69f4345 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:14:36 +0000 Subject: [PATCH 3/3] release: 1.30.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/finch/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 623a7e21..6c6045ba 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.30.2" + ".": "1.30.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d390b899..0963c411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.30.3 (2025-07-11) + +Full Changelog: [v1.30.2...v1.30.3](https://github.com/Finch-API/finch-api-python/compare/v1.30.2...v1.30.3) + +### Bug Fixes + +* **client:** don't send Content-Type header on GET requests ([f1fd42e](https://github.com/Finch-API/finch-api-python/commit/f1fd42e0dd7b4818b3d7fb73e2907b65fbc3889a)) + + +### Chores + +* **readme:** fix version rendering on pypi ([25058bc](https://github.com/Finch-API/finch-api-python/commit/25058bcdc9cfc70711c709bf452fb8a9819a571d)) + ## 1.30.2 (2025-07-09) Full Changelog: [v1.30.1...v1.30.2](https://github.com/Finch-API/finch-api-python/compare/v1.30.1...v1.30.2) diff --git a/pyproject.toml b/pyproject.toml index 838022ac..be6948bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "finch-api" -version = "1.30.2" +version = "1.30.3" description = "The official Python library for the Finch API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/finch/_version.py b/src/finch/_version.py index 4fbd15c8..f9e57b72 100644 --- a/src/finch/_version.py +++ b/src/finch/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "finch" -__version__ = "1.30.2" # x-release-please-version +__version__ = "1.30.3" # x-release-please-version