diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2653b8f..8d58a58 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.2.8" + ".": "1.2.9" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb66c8..ebf0a86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.2.9 (2024-11-22) + +Full Changelog: [v1.2.8...v1.2.9](https://github.com/OneBusAway/python-sdk/compare/v1.2.8...v1.2.9) + +### Chores + +* **internal:** fix compat model_dump method when warnings are passed ([#158](https://github.com/OneBusAway/python-sdk/issues/158)) ([699d488](https://github.com/OneBusAway/python-sdk/commit/699d4889cf96d12c9fc0c538e228daaab97084be)) + ## 1.2.8 (2024-11-18) Full Changelog: [v1.2.7...v1.2.8](https://github.com/OneBusAway/python-sdk/compare/v1.2.7...v1.2.8) diff --git a/pyproject.toml b/pyproject.toml index 59a90c0..3f079a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "onebusaway" -version = "1.2.8" +version = "1.2.9" description = "The official Python library for the onebusaway-sdk API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/onebusaway/_compat.py b/src/onebusaway/_compat.py index 4794129..df173f8 100644 --- a/src/onebusaway/_compat.py +++ b/src/onebusaway/_compat.py @@ -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]", diff --git a/src/onebusaway/_version.py b/src/onebusaway/_version.py index 69905b8..499f851 100644 --- a/src/onebusaway/_version.py +++ b/src/onebusaway/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "onebusaway" -__version__ = "1.2.8" # x-release-please-version +__version__ = "1.2.9" # x-release-please-version diff --git a/tests/test_models.py b/tests/test_models.py index dd618a4..b1c88ed 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -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)