-
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
Add UUID4 support for InspectionError #953
base: main
Are you sure you want to change the base?
Add UUID4 support for InspectionError #953
Conversation
|
||
from pydantic import BaseModel | ||
from pydantic import UUID4, BaseModel |
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 ?
@@ -11,7 +11,7 @@ class InspectionError(BaseModel): | |||
Inspection error details | |||
""" | |||
|
|||
document_id: PydanticObjectId | |||
document_id: Union[PydanticObjectId, UUID4] |
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.
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
DEFAULT_CUSTOM_ENCODERS: MutableMapping[type, SingleArgCallable] = { |
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)
This PR is stale because it has been open 45 days with no activity. |
Fixes #838.