We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug In PyCharm's "Problems" pane. 'null' extra fields not permitted :16
To Reproduce
from pydantic import BaseModel, Extra class Exclusive(BaseModel, extra=Extra.forbid): foo: str | None = None bar: str | None = None class Inclusive(BaseModel): foo: str | None = None bar: str | None = None params = {'foo': 'one', 'bar': 'two'} exclusive1 = Exclusive(**params) exclusive2 = Exclusive(foo='three', bar='four') print(f"{exclusive1}\n{exclusive2}") inclusive1 = Inclusive(**params) inclusive2 = Inclusive(foo='three', bar='four') print(f"{inclusive1}\n{inclusive2}")
/Users/matecsaj/Documents/Projects/nugget_spiders/venv/bin/python /Users/matecsaj/Library/Application Support/JetBrains/PyCharm2022.2/scratches/scratch.py foo='one' bar='two' foo='three' bar='four' foo='one' bar='two' foo='three' bar='four' Process finished with exit code 0
Expected behavior Nothing in the "Problems" pane.
Screenshots
Environments
Additional context In Pycharm Preferences - Plugins I searched for Pydantic and then installed the only plugin in the list.
The text was updated successfully, but these errors were encountered:
FYI, I studied some sample code located with Google and found a workaround. exclusive1 = Exclusive.parse_obj(params)
exclusive1 = Exclusive.parse_obj(params)
Is my original code in error, or is the pydantic plugin?
Sorry, something went wrong.
@matecsaj I'm sorry for my late reply. I have released the fixed version. Thank you very much!!
Successfully merging a pull request may close this issue.
Describe the bug
In PyCharm's "Problems" pane.
'null' extra fields not permitted :16
To Reproduce
Expected behavior
Nothing in the "Problems" pane.
Screenshots
Environments
Additional context
In Pycharm
Preferences - Plugins
I searched for Pydantic and then installed the only plugin in the list.
The text was updated successfully, but these errors were encountered: