Skip to content

Commit f0a48c8

Browse files
release: 1.23.0 (#653)
* chore(internal): bump pyright version * chore(internal): base client updates * feat(api): api update * chore(internal): update models test * codegen metadata * fix(internal): fix fixture import lint * release: 1.23.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: David Meadows <[email protected]>
1 parent 526c62f commit f0a48c8

16 files changed

+81
-18
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.22.0"
2+
".": "1.23.0"
33
}

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-ff61a38530dfae03860bceb49379e84bfc7434eeb5d2f1dc9677cb162014faf1.yml
3-
openapi_spec_hash: df3bdaf4acf575bb07767cae7ca24d69
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-46640c1b468813b828be61b1af5cb5450f9555c4c757c5a740189906a8d56672.yml
3+
openapi_spec_hash: 1d5845ae61d2c0a143db43d579b048c5
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## 1.23.0 (2025-04-21)
4+
5+
Full Changelog: [v1.22.0...v1.23.0](https://github.com/Finch-API/finch-api-python/compare/v1.22.0...v1.23.0)
6+
7+
### Features
8+
9+
* **api:** api update ([6355866](https://github.com/Finch-API/finch-api-python/commit/6355866b36eba70636f458528a9db94d24b38998))
10+
11+
12+
### Bug Fixes
13+
14+
* **internal:** fix fixture import lint ([a4d1919](https://github.com/Finch-API/finch-api-python/commit/a4d19190d65a235e57eb1895645059b01df3332b))
15+
16+
17+
### Chores
18+
19+
* **internal:** base client updates ([dd645de](https://github.com/Finch-API/finch-api-python/commit/dd645de5788da66d69a639904ab95c72eae09a48))
20+
* **internal:** bump pyright version ([9a19507](https://github.com/Finch-API/finch-api-python/commit/9a1950770cb00259bf703f270065252b2a5858b6))
21+
* **internal:** update models test ([8fca672](https://github.com/Finch-API/finch-api-python/commit/8fca67214e73ed85bb66e9fbec2dd2e9454538ac))
22+
323
## 1.22.0 (2025-04-14)
424

525
Full Changelog: [v1.21.1...v1.22.0](https://github.com/Finch-API/finch-api-python/compare/v1.21.1...v1.22.0)

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "finch-api"
3-
version = "1.22.0"
3+
version = "1.23.0"
44
description = "The official Python library for the Finch API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -42,7 +42,7 @@ Repository = "https://github.com/Finch-API/finch-api-python"
4242
managed = true
4343
# version pins are in requirements-dev.lock
4444
dev-dependencies = [
45-
"pyright>=1.1.359",
45+
"pyright==1.1.399",
4646
"mypy",
4747
"respx",
4848
"pytest",

requirements-dev.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pydantic-core==2.27.1
6969
# via pydantic
7070
pygments==2.18.0
7171
# via rich
72-
pyright==1.1.392.post0
72+
pyright==1.1.399
7373
pytest==8.3.3
7474
# via pytest-asyncio
7575
pytest-asyncio==0.24.0

src/finch/_base_client.py

+30-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@
9999
_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any])
100100

101101
if TYPE_CHECKING:
102-
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
102+
from httpx._config import (
103+
DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage]
104+
)
105+
106+
HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG
103107
else:
104108
try:
105109
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
@@ -116,6 +120,7 @@ class PageInfo:
116120

117121
url: URL | NotGiven
118122
params: Query | NotGiven
123+
json: Body | NotGiven
119124

120125
@overload
121126
def __init__(
@@ -131,19 +136,30 @@ def __init__(
131136
params: Query,
132137
) -> None: ...
133138

139+
@overload
140+
def __init__(
141+
self,
142+
*,
143+
json: Body,
144+
) -> None: ...
145+
134146
def __init__(
135147
self,
136148
*,
137149
url: URL | NotGiven = NOT_GIVEN,
150+
json: Body | NotGiven = NOT_GIVEN,
138151
params: Query | NotGiven = NOT_GIVEN,
139152
) -> None:
140153
self.url = url
154+
self.json = json
141155
self.params = params
142156

143157
@override
144158
def __repr__(self) -> str:
145159
if self.url:
146160
return f"{self.__class__.__name__}(url={self.url})"
161+
if self.json:
162+
return f"{self.__class__.__name__}(json={self.json})"
147163
return f"{self.__class__.__name__}(params={self.params})"
148164

149165

@@ -192,6 +208,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions:
192208
options.url = str(url)
193209
return options
194210

211+
if not isinstance(info.json, NotGiven):
212+
if not is_mapping(info.json):
213+
raise TypeError("Pagination is only supported with mappings")
214+
215+
if not options.json_data:
216+
options.json_data = {**info.json}
217+
else:
218+
if not is_mapping(options.json_data):
219+
raise TypeError("Pagination is only supported with mappings")
220+
221+
options.json_data = {**options.json_data, **info.json}
222+
return options
223+
195224
raise ValueError("Unexpected PageInfo state")
196225

197226

src/finch/_models.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
)
2020

2121
import pydantic
22-
import pydantic.generics
2322
from pydantic.fields import FieldInfo
2423

2524
from ._types import (

src/finch/_utils/_typing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class MyResponse(Foo[_T]):
110110
```
111111
"""
112112
cls = cast(object, get_origin(typ) or typ)
113-
if cls in generic_bases:
113+
if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
114114
# we're given the class directly
115115
return extract_type_arg(typ, index)
116116

src/finch/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "finch"
4-
__version__ = "1.22.0" # x-release-please-version
4+
__version__ = "1.23.0" # x-release-please-version

src/finch/resources/sandbox/company.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def update(
7777
7878
primary_email: The email of the main administrator on the account.
7979
80-
primary_phone_number: The phone number of the main administrator on the account. Format: `XXXXXXXXXX`
80+
primary_phone_number: The phone number of the main administrator on the account. Format: E.164, with
81+
extension where applicable, e.g. `+NNNNNNNNNNN xExtension`
8182
8283
extra_headers: Send extra headers
8384
@@ -163,7 +164,8 @@ async def update(
163164
164165
primary_email: The email of the main administrator on the account.
165166
166-
primary_phone_number: The phone number of the main administrator on the account. Format: `XXXXXXXXXX`
167+
primary_phone_number: The phone number of the main administrator on the account. Format: E.164, with
168+
extension where applicable, e.g. `+NNNNNNNNNNN xExtension`
167169
168170
extra_headers: Send extra headers
169171

src/finch/types/hris/company/company.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,7 @@ class Company(BaseModel):
7777
"""The email of the main administrator on the account."""
7878

7979
primary_phone_number: Optional[str] = None
80-
"""The phone number of the main administrator on the account. Format: `XXXXXXXXXX`"""
80+
"""The phone number of the main administrator on the account.
81+
82+
Format: E.164, with extension where applicable, e.g. `+NNNNNNNNNNN xExtension`
83+
"""

src/finch/types/sandbox/company_update_params.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ class CompanyUpdateParams(TypedDict, total=False):
3232
"""The email of the main administrator on the account."""
3333

3434
primary_phone_number: Required[Optional[str]]
35-
"""The phone number of the main administrator on the account. Format: `XXXXXXXXXX`"""
35+
"""The phone number of the main administrator on the account.
36+
37+
Format: E.164, with extension where applicable, e.g. `+NNNNNNNNNNN xExtension`
38+
"""
3639

3740

3841
class Account(TypedDict, total=False):

src/finch/types/sandbox/company_update_response.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,7 @@ class CompanyUpdateResponse(BaseModel):
7474
"""The email of the main administrator on the account."""
7575

7676
primary_phone_number: Optional[str] = None
77-
"""The phone number of the main administrator on the account. Format: `XXXXXXXXXX`"""
77+
"""The phone number of the main administrator on the account.
78+
79+
Format: E.164, with extension where applicable, e.g. `+NNNNNNNNNNN xExtension`
80+
"""

tests/api_resources/test_access_tokens.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
from tests.utils import assert_matches_type
1313

1414
if TYPE_CHECKING:
15-
from _pytest.fixtures import FixtureRequest
15+
16+
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
1617

1718
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1819
client_id = "00000000-0000-0000-0000-000000000000"

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from finch import Finch, AsyncFinch
1111

1212
if TYPE_CHECKING:
13-
from _pytest.fixtures import FixtureRequest
13+
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
1414

1515
pytest.register_assert_rewrite("tests.utils")
1616

tests/test_models.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,15 @@ class Model(BaseModel):
492492
resource_id: Optional[str] = None
493493

494494
m = Model.construct()
495+
assert m.resource_id is None
495496
assert "resource_id" not in m.model_fields_set
496497

497498
m = Model.construct(resource_id=None)
499+
assert m.resource_id is None
498500
assert "resource_id" in m.model_fields_set
499501

500502
m = Model.construct(resource_id="foo")
503+
assert m.resource_id == "foo"
501504
assert "resource_id" in m.model_fields_set
502505

503506

@@ -832,7 +835,7 @@ class B(BaseModel):
832835

833836
@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1")
834837
def test_type_alias_type() -> None:
835-
Alias = TypeAliasType("Alias", str)
838+
Alias = TypeAliasType("Alias", str) # pyright: ignore
836839

837840
class Model(BaseModel):
838841
alias: Alias

0 commit comments

Comments
 (0)