str | None doesn't work
Closed this issue · 3 comments
heindrickdumdum0217 commented
Environment
Pydantic == 2.8.2
pyesorm == 0.4.7
from esorm import ESModel
class A(ESModel)
name: str | None
It throws the following error.
ValueError: Unknown ES field type: str | None
If change str | None
to Optional[str]
, it works.
But I still think it would be great to support Python
new typing feature like str | None
, list[int]
, dict[str, int]
and so on.
wallneradam commented
It is also fixed in the new version, please check it.
heindrickdumdum0217 commented
@wallneradam
When will you release new version?
heindrickdumdum0217 commented
Aha, now I can see new version.
Thank you, I will check right now.