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

default fake data generation should understand the constraint #813

Open
gurmeetsaran opened this issue Dec 5, 2024 · 0 comments
Open

default fake data generation should understand the constraint #813

gurmeetsaran opened this issue Dec 5, 2024 · 0 comments

Comments

@gurmeetsaran
Copy link

Describe the bug
I am trying to create model and add constraint on the value. This works well and does validation when user try to create the instance but default fake data generation do not respect the constraint because it uses fake.pyint() to generate the integer value

To Reproduce
import pydantic
from dataclasses_avroschema.pydantic import AvroBaseModel

class Test(AvroBaseModel):
balance: pydantic.conint(ge=30000000)

class Meta:
    namespace = "com.foo"

print(Test.fake())

Expected behavior
It should generate valid fake value

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

No branches or pull requests

1 participant