Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.10.1"
".": "1.11.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 39
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-c7c3b67aee7f77702be22b17af22bdf799b8c95be8028f20ac406af8b5ec0439.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-2526a31a361274411e6cfc64858b1b084a22ffb491a9490374b717534827b3e1.yml
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 1.11.0 (2024-11-28)

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

### Features

* **api:** api update ([#532](https://github.com/Finch-API/finch-api-python/issues/532)) ([821a77f](https://github.com/Finch-API/finch-api-python/commit/821a77fa1011aa5caa323e451b344f66f36a48eb))


### Bug Fixes

* **client:** compat with new httpx 0.28.0 release ([#533](https://github.com/Finch-API/finch-api-python/issues/533)) ([f5e151c](https://github.com/Finch-API/finch-api-python/commit/f5e151cb90b0acc31a535a70b9b42ec98000c1e2))


### Chores

* **internal:** exclude mypy from running on tests ([#531](https://github.com/Finch-API/finch-api-python/issues/531)) ([a5ce0e7](https://github.com/Finch-API/finch-api-python/commit/a5ce0e704b29d58eee8d56174c949557d4cd1b74))
* remove now unused `cached-property` dep ([#529](https://github.com/Finch-API/finch-api-python/issues/529)) ([7fdf9b7](https://github.com/Finch-API/finch-api-python/commit/7fdf9b7a507cd9c9a4b35f4af60b63d43f63581f))

## 1.10.1 (2024-11-23)

Full Changelog: [v1.10.0...v1.10.1](https://github.com/Finch-API/finch-api-python/compare/v1.10.0...v1.10.1)
Expand Down
5 changes: 4 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ show_error_codes = True
# Exclude _files.py because mypy isn't smart enough to apply
# the correct type narrowing and as this is an internal module
# it's fine to just use Pyright.
exclude = ^(src/finch/_files\.py|_dev/.*\.py)$
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ^(src/finch/_files\.py|_dev/.*\.py|tests/.*)$

strict_equality = True
implicit_reexport = True
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "finch-api"
version = "1.10.1"
version = "1.11.0"
description = "The official Python library for the Finch API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -14,7 +14,6 @@ dependencies = [
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"cached-property; python_version < '3.8'",
]
requires-python = ">= 3.8"
classifiers = [
Expand Down
12 changes: 8 additions & 4 deletions src/finch/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ def __init__(
custom_query: Mapping[str, object] | None = None,
_strict_response_validation: bool,
) -> None:
kwargs: dict[str, Any] = {}
if limits is not None:
warnings.warn(
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
Expand All @@ -805,6 +806,7 @@ def __init__(
limits = DEFAULT_CONNECTION_LIMITS

if transport is not None:
kwargs["transport"] = transport
warnings.warn(
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
category=DeprecationWarning,
Expand All @@ -814,6 +816,7 @@ def __init__(
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")

if proxies is not None:
kwargs["proxies"] = proxies
warnings.warn(
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
category=DeprecationWarning,
Expand Down Expand Up @@ -857,10 +860,9 @@ def __init__(
base_url=base_url,
# cast to a valid type because mypy doesn't understand our type narrowing
timeout=cast(Timeout, timeout),
proxies=proxies,
transport=transport,
limits=limits,
follow_redirects=True,
**kwargs, # type: ignore
)

def is_closed(self) -> bool:
Expand Down Expand Up @@ -1373,6 +1375,7 @@ def __init__(
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
) -> None:
kwargs: dict[str, Any] = {}
if limits is not None:
warnings.warn(
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
Expand All @@ -1385,6 +1388,7 @@ def __init__(
limits = DEFAULT_CONNECTION_LIMITS

if transport is not None:
kwargs["transport"] = transport
warnings.warn(
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
category=DeprecationWarning,
Expand All @@ -1394,6 +1398,7 @@ def __init__(
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")

if proxies is not None:
kwargs["proxies"] = proxies
warnings.warn(
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
category=DeprecationWarning,
Expand Down Expand Up @@ -1437,10 +1442,9 @@ def __init__(
base_url=base_url,
# cast to a valid type because mypy doesn't understand our type narrowing
timeout=cast(Timeout, timeout),
proxies=proxies,
transport=transport,
limits=limits,
follow_redirects=True,
**kwargs, # type: ignore
)

def is_closed(self) -> bool:
Expand Down
5 changes: 1 addition & 4 deletions src/finch/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ def __set_name__(self, owner: type[Any], name: str) -> None: ...
# __set__ is not defined at runtime, but @cached_property is designed to be settable
def __set__(self, instance: object, value: _T) -> None: ...
else:
try:
from functools import cached_property as cached_property
except ImportError:
from cached_property import cached_property as cached_property
from functools import cached_property as cached_property

typed_cached_property = cached_property
2 changes: 1 addition & 1 deletion src/finch/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "finch"
__version__ = "1.10.1" # x-release-please-version
__version__ = "1.11.0" # x-release-please-version
24 changes: 12 additions & 12 deletions src/finch/resources/jobs/automated.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -91,7 +91,7 @@ def create(
self,
*,
individual_id: str,
type: Literal["w4_data_sync"],
type: Literal["w4_form_employee_sync"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -109,8 +109,8 @@ def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -134,7 +134,7 @@ def create(
def create(
self,
*,
type: Literal["data_sync_all"] | Literal["w4_data_sync"],
type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"],
individual_id: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -284,8 +284,8 @@ async def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -308,7 +308,7 @@ async def create(
self,
*,
individual_id: str,
type: Literal["w4_data_sync"],
type: Literal["w4_form_employee_sync"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -326,8 +326,8 @@ async def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -351,7 +351,7 @@ async def create(
async def create(
self,
*,
type: Literal["data_sync_all"] | Literal["w4_data_sync"],
type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"],
individual_id: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down
8 changes: 4 additions & 4 deletions src/finch/types/jobs/automated_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
from typing import Union
from typing_extensions import Literal, Required, TypeAlias, TypedDict

__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4DataSync"]
__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4FormEmployeeSync"]


class DataSyncAll(TypedDict, total=False):
type: Required[Literal["data_sync_all"]]
"""The type of job to start."""


class W4DataSync(TypedDict, total=False):
class W4FormEmployeeSync(TypedDict, total=False):
individual_id: Required[str]
"""The unique ID of the individual for W-4 data sync."""

type: Required[Literal["w4_data_sync"]]
type: Required[Literal["w4_form_employee_sync"]]
"""The type of job to start."""


AutomatedCreateParams: TypeAlias = Union[DataSyncAll, W4DataSync]
AutomatedCreateParams: TypeAlias = Union[DataSyncAll, W4FormEmployeeSync]
12 changes: 6 additions & 6 deletions tests/api_resources/jobs/test_automated.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def test_streaming_response_create_overload_1(self, client: Finch) -> None:
def test_method_create_overload_2(self, client: Finch) -> None:
automated = client.jobs.automated.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)
assert_matches_type(AutomatedCreateResponse, automated, path=["response"])

@parametrize
def test_raw_response_create_overload_2(self, client: Finch) -> None:
response = client.jobs.automated.with_raw_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)

assert response.is_closed is True
Expand All @@ -73,7 +73,7 @@ def test_raw_response_create_overload_2(self, client: Finch) -> None:
def test_streaming_response_create_overload_2(self, client: Finch) -> None:
with client.jobs.automated.with_streaming_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down Expand Up @@ -193,15 +193,15 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncFin
async def test_method_create_overload_2(self, async_client: AsyncFinch) -> None:
automated = await async_client.jobs.automated.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)
assert_matches_type(AutomatedCreateResponse, automated, path=["response"])

@parametrize
async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) -> None:
response = await async_client.jobs.automated.with_raw_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)

assert response.is_closed is True
Expand All @@ -213,7 +213,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) ->
async def test_streaming_response_create_overload_2(self, async_client: AsyncFinch) -> None:
async with async_client.jobs.automated.with_streaming_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down