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
I have searched Google & GitHub for similar requests and couldn't find anything
I have read and followed the docs and still think this feature is missing
Description
It seems like Pydantic V1 had this support, but it was missed on Pydantic V2.
I using Pydantic with project on FastAPI.
In my case I'm working with fast stream of data, so I had to use deque. As for the type hinting I using Sequence[MyModel]
however Pydantic cannot recognize deque as valid Sequence type, even if it is if you check with isinstance(my_deque, Sequence) -> True
Initial Checks
Description
It seems like Pydantic V1 had this support, but it was missed on Pydantic V2.
I using Pydantic with project on FastAPI.
In my case I'm working with fast stream of data, so I had to use
deque
. As for the type hinting I usingSequence[MyModel]
however Pydantic cannot recognize
deque
as validSequence
type, even if it is if you check withisinstance(my_deque, Sequence)
->True
When it trying to serialize, it throw error:
Project running in Docker with
requirements.txt
:(not related requirements are omitted)
2.4.2 is current version
Affected Components
.model_dump()
and.model_dump_json()
model_construct()
, pickling, private attributes, ORM modeThe text was updated successfully, but these errors were encountered: