Skip to content

Commit 9f754f7

Browse files
committed
fix: we want to not change validated object to missing.
1 parent cd58c7d commit 9f754f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pydantic_partials/sentinels.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ def __get_pydantic_core_schema__(
2828

2929
@staticmethod
3030
def _validate(value: Any, info: core_schema.ValidationInfo) -> 'MissingType':
31-
# Tells Pydantic that our Sentinel value 'Missing' is our validated value.
32-
# return Missing
31+
if value is Missing:
32+
# Keeps the associated attribute 'deleted/omitted' from model.
33+
raise PydanticOmit()
3334

34-
# Keeps the associated attribute 'deleted/omitted' from model.
35-
#
36-
raise PydanticOmit()
35+
# `value` is not Missing, return it unchanged.
36+
return value
3737

3838
@staticmethod
3939
def _serialize(value: Any) -> 'MissingType':

0 commit comments

Comments
 (0)