Release v1.0.2 (#4175)
This commit is contained in:
committed by
GitHub
parent
2961fdd721
commit
d9610701d3
@@ -22,10 +22,10 @@ class BaseClientWrapper:
|
||||
|
||||
def get_headers(self) -> typing.Dict[str, str]:
|
||||
headers: typing.Dict[str, str] = {
|
||||
"User-Agent": "skyvern/1.0.0",
|
||||
"User-Agent": "skyvern/1.0.2",
|
||||
"X-Fern-Language": "Python",
|
||||
"X-Fern-SDK-Name": "skyvern",
|
||||
"X-Fern-SDK-Version": "1.0.0",
|
||||
"X-Fern-SDK-Version": "1.0.2",
|
||||
**(self.get_custom_headers() or {}),
|
||||
}
|
||||
if self._api_key is not None:
|
||||
|
||||
@@ -7,10 +7,6 @@ from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set,
|
||||
|
||||
import pydantic
|
||||
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .serialization import convert_and_respect_annotation_metadata
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
@@ -32,6 +28,9 @@ else:
|
||||
from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef]
|
||||
from pydantic.typing import is_union as is_union # type: ignore[no-redef]
|
||||
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .serialization import convert_and_respect_annotation_metadata
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
T = TypeVar("T")
|
||||
Model = TypeVar("Model", bound=pydantic.BaseModel)
|
||||
@@ -248,7 +247,7 @@ def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]:
|
||||
def _get_field_default(field: PydanticField) -> Any:
|
||||
try:
|
||||
value = field.get_default() # type: ignore[union-attr]
|
||||
except Exception:
|
||||
except:
|
||||
value = field.default
|
||||
if IS_PYDANTIC_V2:
|
||||
from pydantic_core import PydanticUndefined
|
||||
|
||||
@@ -72,7 +72,7 @@ def convert_and_respect_annotation_metadata(
|
||||
|
||||
if (
|
||||
typing_extensions.get_origin(clean_type) == typing.Dict
|
||||
or typing_extensions.get_origin(clean_type) is dict
|
||||
or typing_extensions.get_origin(clean_type) == dict
|
||||
or clean_type == typing.Dict
|
||||
) and isinstance(object_, typing.Dict):
|
||||
key_type = typing_extensions.get_args(clean_type)[0]
|
||||
@@ -92,7 +92,7 @@ def convert_and_respect_annotation_metadata(
|
||||
if not isinstance(object_, str):
|
||||
if (
|
||||
typing_extensions.get_origin(clean_type) == typing.Set
|
||||
or typing_extensions.get_origin(clean_type) is set
|
||||
or typing_extensions.get_origin(clean_type) == set
|
||||
or clean_type == typing.Set
|
||||
) and isinstance(object_, typing.Set):
|
||||
inner_type = typing_extensions.get_args(clean_type)[0]
|
||||
@@ -108,14 +108,14 @@ def convert_and_respect_annotation_metadata(
|
||||
elif (
|
||||
(
|
||||
typing_extensions.get_origin(clean_type) == typing.List
|
||||
or typing_extensions.get_origin(clean_type) is list
|
||||
or typing_extensions.get_origin(clean_type) == list
|
||||
or clean_type == typing.List
|
||||
)
|
||||
and isinstance(object_, typing.List)
|
||||
) or (
|
||||
(
|
||||
typing_extensions.get_origin(clean_type) == typing.Sequence
|
||||
or typing_extensions.get_origin(clean_type) is collections.abc.Sequence
|
||||
or typing_extensions.get_origin(clean_type) == collections.abc.Sequence
|
||||
or clean_type == typing.Sequence
|
||||
)
|
||||
and isinstance(object_, typing.Sequence)
|
||||
@@ -131,7 +131,7 @@ def convert_and_respect_annotation_metadata(
|
||||
for item in object_
|
||||
]
|
||||
|
||||
if typing_extensions.get_origin(clean_type) is typing.Union:
|
||||
if typing_extensions.get_origin(clean_type) == typing.Union:
|
||||
# We should be able to ~relatively~ safely try to convert keys against all
|
||||
# member types in the union, the edge case here is if one member aliases a field
|
||||
# of the same name to a different name from another member
|
||||
|
||||
Reference in New Issue
Block a user