Skip to content

Commit c2f8537

Browse files
chore(internal): update pydantic dependency
1 parent ca268a3 commit c2f8537

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

requirements-dev.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ pluggy==1.5.0
9696
propcache==0.3.1
9797
# via aiohttp
9898
# via yarl
99-
pydantic==2.10.3
99+
pydantic==2.11.9
100100
# via writer-sdk
101-
pydantic-core==2.27.1
101+
pydantic-core==2.33.2
102102
# via pydantic
103103
pygments==2.18.0
104104
# via rich
@@ -135,7 +135,10 @@ typing-extensions==4.12.2
135135
# via pydantic
136136
# via pydantic-core
137137
# via pyright
138+
# via typing-inspection
138139
# via writer-sdk
140+
typing-inspection==0.4.1
141+
# via pydantic
139142
virtualenv==20.24.5
140143
# via nox
141144
yarl==1.20.0

requirements.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ multidict==6.4.4
5757
propcache==0.3.1
5858
# via aiohttp
5959
# via yarl
60-
pydantic==2.10.3
60+
pydantic==2.11.9
6161
# via writer-sdk
62-
pydantic-core==2.27.1
62+
pydantic-core==2.33.2
6363
# via pydantic
6464
sniffio==1.3.0
6565
# via anyio
@@ -69,6 +69,9 @@ typing-extensions==4.12.2
6969
# via multidict
7070
# via pydantic
7171
# via pydantic-core
72+
# via typing-inspection
7273
# via writer-sdk
74+
typing-inspection==0.4.1
75+
# via pydantic
7376
yarl==1.20.0
7477
# via aiohttp

src/writerai/_models.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,15 @@ def model_dump(
257257
mode: Literal["json", "python"] | str = "python",
258258
include: IncEx | None = None,
259259
exclude: IncEx | None = None,
260-
by_alias: bool = False,
260+
by_alias: bool | None = None,
261261
exclude_unset: bool = False,
262262
exclude_defaults: bool = False,
263263
exclude_none: bool = False,
264264
round_trip: bool = False,
265265
warnings: bool | Literal["none", "warn", "error"] = True,
266266
context: dict[str, Any] | None = None,
267267
serialize_as_any: bool = False,
268+
fallback: Callable[[Any], Any] | None = None,
268269
) -> dict[str, Any]:
269270
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
270271
@@ -296,10 +297,12 @@ def model_dump(
296297
raise ValueError("context is only supported in Pydantic v2")
297298
if serialize_as_any != False:
298299
raise ValueError("serialize_as_any is only supported in Pydantic v2")
300+
if fallback is not None:
301+
raise ValueError("fallback is only supported in Pydantic v2")
299302
dumped = super().dict( # pyright: ignore[reportDeprecated]
300303
include=include,
301304
exclude=exclude,
302-
by_alias=by_alias,
305+
by_alias=by_alias if by_alias is not None else False,
303306
exclude_unset=exclude_unset,
304307
exclude_defaults=exclude_defaults,
305308
exclude_none=exclude_none,
@@ -314,13 +317,14 @@ def model_dump_json(
314317
indent: int | None = None,
315318
include: IncEx | None = None,
316319
exclude: IncEx | None = None,
317-
by_alias: bool = False,
320+
by_alias: bool | None = None,
318321
exclude_unset: bool = False,
319322
exclude_defaults: bool = False,
320323
exclude_none: bool = False,
321324
round_trip: bool = False,
322325
warnings: bool | Literal["none", "warn", "error"] = True,
323326
context: dict[str, Any] | None = None,
327+
fallback: Callable[[Any], Any] | None = None,
324328
serialize_as_any: bool = False,
325329
) -> str:
326330
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
@@ -349,11 +353,13 @@ def model_dump_json(
349353
raise ValueError("context is only supported in Pydantic v2")
350354
if serialize_as_any != False:
351355
raise ValueError("serialize_as_any is only supported in Pydantic v2")
356+
if fallback is not None:
357+
raise ValueError("fallback is only supported in Pydantic v2")
352358
return super().json( # type: ignore[reportDeprecated]
353359
indent=indent,
354360
include=include,
355361
exclude=exclude,
356-
by_alias=by_alias,
362+
by_alias=by_alias if by_alias is not None else False,
357363
exclude_unset=exclude_unset,
358364
exclude_defaults=exclude_defaults,
359365
exclude_none=exclude_none,

0 commit comments

Comments
 (0)