-
Notifications
You must be signed in to change notification settings - Fork 212
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
Add UUID4 support for InspectionError #953
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,6 +1,6 @@ | ||||
from typing import List | ||||
from typing import List, Union | ||||
|
||||
from pydantic import BaseModel | ||||
from pydantic import UUID4, BaseModel | ||||
|
||||
from beanie.odm.enums import InspectionStatuses | ||||
from beanie.odm.fields import PydanticObjectId | ||||
|
@@ -11,7 +11,7 @@ class InspectionError(BaseModel): | |||
Inspection error details | ||||
""" | ||||
|
||||
document_id: PydanticObjectId | ||||
document_id: Union[PydanticObjectId, UUID4] | ||||
error: str | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since you can technicaly overide id (needs to be tested) with anything that is serializable by beanie... this is is probably not enough (we should probably create Union of Anything serializable probably something here beanie/beanie/odm/utils/encoder.py Line 30 in 54e0f2d
we have str as id and this would not work I also do not see any tests and it appears there is techical Debt in InspectionErrorCoverage it is however coverable... you insert with another library somethig that would triger InspectionError second atitional test is to test if such type can be used as id (so use union of serializable to do that) |
||||
|
||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why just UUID 4 and not UUID ?