Skip to content
Discussion options

You must be logged in to vote

Hi Mause,

Thank you for your reply.

This is caused by the underlying postgres library being used. I'm guessing there is some magic going on in the Record object of asyncpg. My guess is that the returned Record from the library does not expose the properties. Thus it requires to manually select the attributes to be fed into the pydantic model.

The function I provided above does the casting automatically when aiomysql is used (MySQL is the underlying database). The object I receive from that function is truly a Pydantic "Device" object.

This has been my findings since I asked the question. :-)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
2 participants
Converted from issue

This discussion was converted from issue #3289 on February 28, 2023 16:54.