-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X
Description
Checks
- I added a descriptive title to this issue
- I have searched (google, github) for similar issues and couldn't find anything
- I have read and followed the docs and still think this is a bug
Bug
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":
pydantic version: 1.7.2
pydantic compiled: False
install path: /usr/local/lib/python3.6/dist-packages/pydantic
python version: 3.6.9 (default, Oct 8 2020, 12:12:24) [GCC 8.4.0]
platform: Linux-4.15.0-112-generic-x86_64-with-Ubuntu-18.04-bionic
optional deps. installed: ['typing-extensions', 'email-validator']
from typing import Optional
import pydantic
class Foo(pydantic.BaseModel):
foo: Optional[str]
bar: Optional[str]
print(Foo(foo='hello')
.copy(update={'bar': 'world'})
.json(exclude_unset=True))
# Observed: {"foo": "hello"}
# Expected: {"foo": "hello", "bar": "world"}Metadata
Metadata
Assignees
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X