Fern: regenerated Python SDK (#3829)
This commit is contained in:
committed by
GitHub
parent
c12c047768
commit
ba0b25cb4b
@@ -4,9 +4,8 @@ import collections
|
||||
import inspect
|
||||
import typing
|
||||
|
||||
import typing_extensions
|
||||
|
||||
import pydantic
|
||||
import typing_extensions
|
||||
|
||||
|
||||
class FieldMetadata:
|
||||
@@ -161,7 +160,12 @@ def _convert_mapping(
|
||||
direction: typing.Literal["read", "write"],
|
||||
) -> typing.Mapping[str, object]:
|
||||
converted_object: typing.Dict[str, object] = {}
|
||||
annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
|
||||
try:
|
||||
annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
|
||||
except NameError:
|
||||
# The TypedDict contains a circular reference, so
|
||||
# we use the __annotations__ attribute directly.
|
||||
annotations = getattr(expected_type, "__annotations__", {})
|
||||
aliases_to_field_names = _get_alias_to_field_name(annotations)
|
||||
for key, value in object_.items():
|
||||
if direction == "read" and key in aliases_to_field_names:
|
||||
|
||||
Reference in New Issue
Block a user