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.0"
".": "1.10.1"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 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)

### Chores

* **internal:** fix compat model_dump method when warnings are passed ([#525](https://github.com/Finch-API/finch-api-python/issues/525)) ([6465256](https://github.com/Finch-API/finch-api-python/commit/6465256a5ea41a1d06645fb129fe03237a503ca6))


### Documentation

* add info log level to readme ([#527](https://github.com/Finch-API/finch-api-python/issues/527)) ([28ca9f0](https://github.com/Finch-API/finch-api-python/commit/28ca9f0f4ff5d727e7dbdd1affb6d65a3cf5c030))

## 1.10.0 (2024-11-19)

Full Changelog: [v1.9.0...v1.10.0](https://github.com/Finch-API/finch-api-python/compare/v1.9.0...v1.10.0)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,14 @@ client = Finch(

We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

You can enable logging by setting the environment variable `FINCH_LOG` to `debug`.
You can enable logging by setting the environment variable `FINCH_LOG` to `info`.

```shell
$ export FINCH_LOG=debug
$ export FINCH_LOG=info
```

Or to `debug` for more verbose logging.

### How to tell whether `None` means `null` or missing

In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "finch-api"
version = "1.10.0"
version = "1.10.1"
description = "The official Python library for the Finch API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
3 changes: 2 additions & 1 deletion src/finch/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def model_dump(
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
warnings=warnings,
# warnings are not supported in Pydantic v1
warnings=warnings if PYDANTIC_V2 else True,
)
return cast(
"dict[str, Any]",
Expand Down
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.0" # x-release-please-version
__version__ = "1.10.1" # x-release-please-version
8 changes: 8 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ class Model(BaseModel):
m.model_dump(warnings=False)


def test_compat_method_no_error_for_warnings() -> None:
class Model(BaseModel):
foo: Optional[str]

m = Model(foo="hello")
assert isinstance(model_dump(m, warnings=False), dict)


def test_to_json() -> None:
class Model(BaseModel):
foo: Optional[str] = Field(alias="FOO", default=None)
Expand Down