Skip to content

Commit 3ba4701

Browse files
chore(internal): update pydantic dependency
1 parent 529f3af commit 3ba4701

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

requirements-dev.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ pluggy==1.5.0
8888
propcache==0.3.1
8989
# via aiohttp
9090
# via yarl
91-
pydantic==2.10.3
91+
pydantic==2.11.9
9292
# via julep
93-
pydantic-core==2.27.1
93+
pydantic-core==2.33.2
9494
# via pydantic
9595
pygments==2.18.0
9696
# via rich
@@ -132,6 +132,9 @@ typing-extensions==4.12.2
132132
# via pydantic
133133
# via pydantic-core
134134
# via pyright
135+
# via typing-inspection
136+
typing-inspection==0.4.1
137+
# via pydantic
135138
virtualenv==20.24.5
136139
# via nox
137140
yarl==1.20.0

requirements.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ multidict==6.4.4
5555
propcache==0.3.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.10.3
58+
pydantic==2.11.9
5959
# via julep
60-
pydantic-core==2.27.1
60+
pydantic-core==2.33.2
6161
# via pydantic
6262
python-dotenv==1.0.1
6363
# via julep
@@ -74,5 +74,8 @@ typing-extensions==4.12.2
7474
# via multidict
7575
# via pydantic
7676
# via pydantic-core
77+
# via typing-inspection
78+
typing-inspection==0.4.1
79+
# via pydantic
7780
yarl==1.20.0
7881
# via aiohttp

src/julep/_models.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,15 @@ def model_dump(
256256
mode: Literal["json", "python"] | str = "python",
257257
include: IncEx | None = None,
258258
exclude: IncEx | None = None,
259-
by_alias: bool = False,
259+
by_alias: bool | None = None,
260260
exclude_unset: bool = False,
261261
exclude_defaults: bool = False,
262262
exclude_none: bool = False,
263263
round_trip: bool = False,
264264
warnings: bool | Literal["none", "warn", "error"] = True,
265265
context: dict[str, Any] | None = None,
266266
serialize_as_any: bool = False,
267+
fallback: Callable[[Any], Any] | None = None,
267268
) -> dict[str, Any]:
268269
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
269270
@@ -295,10 +296,12 @@ def model_dump(
295296
raise ValueError("context is only supported in Pydantic v2")
296297
if serialize_as_any != False:
297298
raise ValueError("serialize_as_any is only supported in Pydantic v2")
299+
if fallback is not None:
300+
raise ValueError("fallback is only supported in Pydantic v2")
298301
dumped = super().dict( # pyright: ignore[reportDeprecated]
299302
include=include,
300303
exclude=exclude,
301-
by_alias=by_alias,
304+
by_alias=by_alias if by_alias is not None else False,
302305
exclude_unset=exclude_unset,
303306
exclude_defaults=exclude_defaults,
304307
exclude_none=exclude_none,
@@ -313,13 +316,14 @@ def model_dump_json(
313316
indent: int | None = None,
314317
include: IncEx | None = None,
315318
exclude: IncEx | None = None,
316-
by_alias: bool = False,
319+
by_alias: bool | None = None,
317320
exclude_unset: bool = False,
318321
exclude_defaults: bool = False,
319322
exclude_none: bool = False,
320323
round_trip: bool = False,
321324
warnings: bool | Literal["none", "warn", "error"] = True,
322325
context: dict[str, Any] | None = None,
326+
fallback: Callable[[Any], Any] | None = None,
323327
serialize_as_any: bool = False,
324328
) -> str:
325329
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
@@ -348,11 +352,13 @@ def model_dump_json(
348352
raise ValueError("context is only supported in Pydantic v2")
349353
if serialize_as_any != False:
350354
raise ValueError("serialize_as_any is only supported in Pydantic v2")
355+
if fallback is not None:
356+
raise ValueError("fallback is only supported in Pydantic v2")
351357
return super().json( # type: ignore[reportDeprecated]
352358
indent=indent,
353359
include=include,
354360
exclude=exclude,
355-
by_alias=by_alias,
361+
by_alias=by_alias if by_alias is not None else False,
356362
exclude_unset=exclude_unset,
357363
exclude_defaults=exclude_defaults,
358364
exclude_none=exclude_none,

0 commit comments

Comments
 (0)