-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
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
[BUG] Backlinks cause errors when using documents as part of Pydantic union types #985
Comments
This issue is stale because it has been open 30 days with no activity. |
Not stale still an issue |
This issue is stale because it has been open 30 days with no activity. |
Not stale still an issue. We're migrating away from beanie because of too many issues like this. Won't un-stale it again, but it just means the bug will remain unadressed if it gets closed automatically next time |
Hi @ldorigo, According to the Relations documentation, you are missing the |
Describe the bug
If I have a document containing backlinks; using that document within a pydantic basemodel that uses union types causes an exception. See simple MRO below.
To Reproduce
Note that the same happens with a simplified example without inheritance:
The error:
Note that the error always happens on the second item in the union type: if we define
Answer
withmessage: WelcomeMessage | EscalationProposalMessage
, then assigning a WelcomeMessage tomessages
works, but it breaks when assigning an EscalationProposalMessage.The text was updated successfully, but these errors were encountered: