Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nikstuckenbrock
Copy link

Fixes #838.


from pydantic import BaseModel
from pydantic import UUID4, BaseModel
Copy link
Member

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]
Copy link
Member

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

DEFAULT_CUSTOM_ENCODERS: MutableMapping[type, SingleArgCallable] = {
) (somewhere close to Here
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] UUIDs are not supported as ID types in Document.inspect_collection
2 participants