Skip to content

Commit e581082

Browse files
chore(internal): update pydantic dependency
1 parent 86c9324 commit e581082

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
@@ -92,9 +92,9 @@ pluggy==1.5.0
9292
propcache==0.3.1
9393
# via aiohttp
9494
# via yarl
95-
pydantic==2.10.3
95+
pydantic==2.11.9
9696
# via imagekit
97-
pydantic-core==2.27.1
97+
pydantic-core==2.33.2
9898
# via pydantic
9999
pygments==2.18.0
100100
# via rich
@@ -137,6 +137,9 @@ typing-extensions==4.12.2
137137
# via pydantic
138138
# via pydantic-core
139139
# via pyright
140+
# via typing-inspection
141+
typing-inspection==0.4.1
142+
# via pydantic
140143
virtualenv==20.24.5
141144
# via nox
142145
wrapt==1.17.3

requirements.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ multidict==6.4.4
5959
propcache==0.3.1
6060
# via aiohttp
6161
# via yarl
62-
pydantic==2.10.3
62+
pydantic==2.11.9
6363
# via imagekit
64-
pydantic-core==2.27.1
64+
pydantic-core==2.33.2
6565
# via pydantic
6666
python-dateutil==2.9.0.post0
6767
# via standardwebhooks
@@ -82,6 +82,9 @@ typing-extensions==4.12.2
8282
# via multidict
8383
# via pydantic
8484
# via pydantic-core
85+
# via typing-inspection
86+
typing-inspection==0.4.1
87+
# via pydantic
8588
wrapt==1.17.3
8689
# via deprecated
8790
yarl==1.20.0

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