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
Deque
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
pydantic version: 1.8.2 pydantic compiled: False install path: /home/sergej/Projects/pydantic/pydantic python version: 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0] platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.29 optional deps. installed: ['devtools', 'dotenv', 'email-validator', 'typing-extensions']
The AssertionError occurs on JSON schema generation if Deque field used in the Pydantic model.
AssertionError
from typing import Deque from pydantic import BaseModel class Model(BaseModel): a: Deque[str] Model.schema()
Traceback (most recent call last): File "/home/sergej/Projects/pydantic/test_deque.py", line 10, in <module> Model.schema() File "/home/sergej/Projects/pydantic/pydantic/main.py", line 720, in schema s = model_schema(cls, by_alias=by_alias, ref_template=ref_template) File "/home/sergej/Projects/pydantic/pydantic/schema.py", line 168, in model_schema m_schema, m_definitions, nested_models = model_process_schema( File "/home/sergej/Projects/pydantic/pydantic/schema.py", line 557, in model_process_schema m_schema, m_definitions, nested_models = model_type_schema( File "/home/sergej/Projects/pydantic/pydantic/schema.py", line 598, in model_type_schema f_schema, f_definitions, f_nested_models = field_schema( File "/home/sergej/Projects/pydantic/pydantic/schema.py", line 242, in field_schema f_schema, f_definitions, f_nested_models = field_type_schema( File "/home/sergej/Projects/pydantic/pydantic/schema.py", line 503, in field_type_schema assert field.shape in {SHAPE_SINGLETON, SHAPE_GENERIC}, field.shape AssertionError: 11
The text was updated successfully, but these errors were encountered:
+1 to this. I just ran into the same error and confirmed that the linked PR fixes the bug
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Checks
Bug
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:Description
The
AssertionError
occurs on JSON schema generation ifDeque
field used in the Pydantic model.Example
Output
The text was updated successfully, but these errors were encountered: