Skip to content

Commit

Permalink
Refactoring code for Enterprise issue #529
Browse files Browse the repository at this point in the history
  • Loading branch information
amontanez24 committed Apr 29, 2024
1 parent 7f309bd commit 1b75bab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rdt/transformers/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ def _warn_not_enough_unique_values(self, sample_size):
f'values (only {max(remaining, 0)} unique values left).'
)

def _get_remaining_generator_values(self):
return list(self.generator)

def _reverse_transform(self, data):
"""Generate new data using the provided ``regex_format``.
Expand Down Expand Up @@ -209,9 +212,9 @@ def _reverse_transform(self, data):
self.generated += sample_size

else:
generated_values = list(self.generator)
generated_values = self._get_remaining_generator_values()
reverse_transformed = generated_values[:]
self.generated = self.generator_size
self.generated += len(generated_values)
if self.enforce_uniqueness:
try:
remaining_samples = sample_size - len(reverse_transformed)
Expand Down

0 comments on commit 1b75bab

Please sign in to comment.