Relaxing pydantic input (asyncpg.Record) #6917
-
I am selecting custom type from Postgres database using asyncpg, the type asyncpg returns is Record When I am trying to put the data into Pydantic i get error: location
Input should be a valid dictionary or instance of FailureLocationV1 [type=model_type, input_value=<Record city='string' str...pes.Point((32.0, 45.0))>, input_type=Record]
For further information visit https://errors.pydantic.dev/2.1/v/model_type Is there a way to make pydantic more relaxed about the input types or a way to make it work on, or make it work with any current feature? |
Beta Was this translation helpful? Give feedback.
Answered by
samuelcolvin
May 10, 2024
Replies: 1 comment
-
The solution is |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
syniex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The solution is
Mapping.register(asyncpg.Record)
, I've explained in more detail on #9406.