litestar-org/polyfactory

How to get around reserved fields

maxisme opened this issue · 1 comments

I am getting the error:

ModelFactory.should_set_field_value() got multiple values for argument 'field_name'

because I guess field_name is reserved but it is also a field in my pydantic baseclass:

class FooFactory(ModelFactory):
    __model__ = Foo

class Foo(BaseModel):
    field_name: str

...

FooFactory.build() # throws the above error

Is there anyway to get around this?

Hi, we need a minimal reproduction to ascertain what's going on. Please provide one 😁