-
Notifications
You must be signed in to change notification settings - Fork 276
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestimprovement
Description
Describe the bug
Document._class_id is overwritten. Document initialization should check if it's set before assigning a value. This messes up the customization of document discriminators and leads to failing queries (update, find, link fetching...).
To Reproduce
Create a couple of documents (with inheritance pattern), set Settings.class_id for example to "type", add type: str = "my-doc-type-1", type: str = "my-doc-type-2", ... properties to documents and also set _class_id on each document to the same value as the type property.
Expected behavior
Update, find, link fetching queries work.
Additional context
I'll submit a PR with a fix that avoids overwriting _class_id if it's already set. It solves the issues.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestimprovement