Skip to content

Commit

Permalink
v1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyorlando authored Oct 10, 2024
2 parents a1270db + 93c0750 commit fc60847
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engine/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@

# Faker that always returns unique values
class UniqueFaker(factory.Faker):
def __init__(self, provider, **kwargs):
if provider == "pyint":
# https://faker.readthedocs.io/en/master/providers/faker.providers.python.html#faker.providers.python.Provider.pyint
# https://raintank-corp.slack.com/archives/C06K1MQ07GS/p1728589562495709?thread_ts=1728586969.283779&cid=C06K1MQ07GS
kwargs["max_value"] = 9_999_999

super().__init__(provider, **kwargs)

@classmethod
def _get_faker(cls, locale=None):
return super()._get_faker(locale).unique
Expand Down

0 comments on commit fc60847

Please sign in to comment.