Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update forward refs continues to be silent #4110

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def encode_by_type(o: typing.Any) -> typing.Any:

def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
if IS_PYDANTIC_V2:
model.model_rebuild(force=True) # type: ignore # Pydantic v2
model.model_rebuild(force=True, raise_errors=False) # type: ignore # Pydantic v2
else:
model.update_forward_refs(**localns)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def encode_by_type(o: typing.Any) -> typing.Any:

def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
if IS_PYDANTIC_V2:
model.model_rebuild(force=True) # type: ignore # Pydantic v2
model.model_rebuild(force=True, raise_errors=False) # type: ignore # Pydantic v2
else:
model.update_forward_refs(**localns)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def encode_by_type(o: typing.Any) -> typing.Any:

def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
if IS_PYDANTIC_V2:
model.model_rebuild(force=True) # type: ignore # Pydantic v2
model.model_rebuild(force=True, raise_errors=False) # type: ignore # Pydantic v2
else:
model.update_forward_refs(**localns)

Expand Down
8 changes: 6 additions & 2 deletions generators/python/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.0-rc1] - 2024-07-16
## [3.0.0-rc2] - 2024-07-24

- Fix: `update_forward_refs` no longer raises errors, preserving original behavior, pre-3.x.

## [3.0.0-rc1] - 2024-07-23

- Fix: Sometimes mypy will error on the typing of `expected_types` within our test suite, despite them being labeled as `typing.Any`. This updates the types for tuples to `typing.Tuple[tying.Any, typing.Any]` to appease mypy.

## [3.0.0-rc0] - 2024-07-16
## [3.0.0-rc0] - 2024-07-23

- Break: The generated SDK now supports Pydantic V2 outright, it no longer uses `pydantic.v1` models. This change introduces additional breaks:
- Wrapped aliases have been removed
Expand Down
2 changes: 1 addition & 1 deletion generators/python/sdk/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0-rc1
3.0.0-rc2
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def encode_by_type(o: typing.Any) -> typing.Any:

def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
if IS_PYDANTIC_V2:
model.model_rebuild(force=True) # type: ignore # Pydantic v2
model.model_rebuild(force=True, raise_errors=False) # type: ignore # Pydantic v2
else:
model.update_forward_refs(**localns)

Expand Down
Loading