Environment Details
Please indicate the following details about the environment in which you found the bug:
- RDT version:
- Python version:
- Operating System:
Error Description
For RegexGenerator, consecutive reverse_transform calls can return already generated values even if cardinality_rule is set to unique. As long as randomization has not been reset, reverse_transform should always generate a new unique value, using appropriate fallbacks if the original generator has been exhausted.
Steps to reproduce
transformer = RegexGenerator(regex_format=r'\d', cardinality_rule='unique')
transformer.fit(pd.DataFrame(columns=['id']), 'id')
samples = pd.concat([transformer.reverse_transform(pd.DataFrame(index=[0])) for i in range(50)])['id']
assert samples.is_unique
Environment Details
Please indicate the following details about the environment in which you found the bug:
Error Description
For
RegexGenerator, consecutivereverse_transformcalls can return already generated values even ifcardinality_ruleis set tounique. As long as randomization has not been reset,reverse_transformshould always generate a new unique value, using appropriate fallbacks if the original generator has been exhausted.Steps to reproduce