hi! /ᐠ. ̫ .ᐟ\ฅ
A pydantic model with a EmailStr
field raises polyfactory.exceptions.ParameterException: received constraints for unsupported type <class 'pydantic.networks.EmailStr'>
if used with Field
constraints.
related: https://github.com/litestar-org/polyfactory/discussions/616
No response
from polyfactory.factories.pydantic_factory import ModelFactory
from pydantic import BaseModel, EmailStr, Field
class Email(BaseModel):
email: EmailStr = Field(max_length=20)
class EmailFactory(ModelFactory[Email]): ...
def test_factory():
email = EmailFactory.build()
test_factory()
1. Copy and paste MCVE into a python file
2. Assuming pydantic and polyfactory are installed, execute the file
3. See error
"In the format of: 
"
2.19.0
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too