wallneradam / esorm

Python ElasticSearch ORM based on Pydantic
https://esorm.readthedocs.io/
Mozilla Public License 2.0
31 stars 0 forks source link

Pydantic UUID4 doesn't work #10

Closed heindrickdumdum0217 closed 1 month ago

heindrickdumdum0217 commented 1 month ago

Environment

Pydantic == 2.8.2
pyesorm == 0.4.8
from esorm import ESModel
from pydantic import UUID4

class A(ESModel)
    uuid: UUID4

It throws the following error.

ValueError: Unknown ES field type: <class 'uuid.UUID'>
wallneradam commented 1 month ago

Not all Pydantic type is supported, because there is no UUID field in elasticsearch. UUID is an object, not a base type. I will investigate if these types could be converted to base types in a general way.

wallneradam commented 1 month ago

It is working in the new version (v0.5.0).