Skip to content

Commit 84de7b6

Browse files
chore(internal): update pydantic dependency
1 parent f36fac4 commit 84de7b6

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
@@ -91,9 +91,9 @@ pluggy==1.5.0
9191
propcache==0.3.1
9292
# via aiohttp
9393
# via yarl
94-
pydantic==2.10.3
94+
pydantic==2.11.9
9595
# via cloudflare
96-
pydantic-core==2.27.1
96+
pydantic-core==2.33.2
9797
# via pydantic
9898
pygments==2.18.0
9999
# via rich
@@ -129,6 +129,9 @@ typing-extensions==4.12.2
129129
# via pydantic
130130
# via pydantic-core
131131
# via pyright
132+
# via typing-inspection
133+
typing-inspection==0.4.1
134+
# via pydantic
132135
virtualenv==20.24.5
133136
# via nox
134137
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 cloudflare
60-
pydantic-core==2.27.1
60+
pydantic-core==2.33.2
6161
# via pydantic
6262
sniffio==1.3.0
6363
# via anyio
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
6868
# via multidict
6969
# via pydantic
7070
# via pydantic-core
71+
# via typing-inspection
72+
typing-inspection==0.4.1
73+
# via pydantic
7174
yarl==1.20.0
7275
# via aiohttp

src/cloudflare/_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)