You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running on python 3.8.0 on Windows 10, 32-bit version in a venv. desert retrieved from master commit a9b41e1.
desert does not support reading input data containing None from a schema with Optional type. The following test shows the issue:
def test_optional_present(module):
"""Including optional with None set the field."""
@module.dataclass
class A:
x: t.Optional[int]
data = desert.schema_class(A)().load({"x": None})
assert data == A(None)
This will fail with the error: marshmallow.exceptions.ValidationError: {'x': ['Field may not be null.']}. The documentation for typing.Optional states that it is equivalent of Union[X, None] indicates that None is valid input to a Optional field.
The text was updated successfully, but these errors were encountered:
Running on python 3.8.0 on Windows 10, 32-bit version in a venv.
desert
retrieved from master commit a9b41e1.desert
does not support reading input data containing None from a schema with Optional type. The following test shows the issue:This will fail with the error: marshmallow.exceptions.ValidationError: {'x': ['Field may not be null.']}. The documentation for
typing.Optional
states that it is equivalent ofUnion[X, None]
indicates thatNone
is valid input to aOptional
field.The text was updated successfully, but these errors were encountered: