You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Templates which contain square brackets fail on generating new fake data. Square brackets are converted to curly brackets to be treated as entities i.e -> "{{entity}}". Method _prep_templates responsible for the replacement.
Is this the desired behavior?
How to reproduce the error:
from faker import Faker
fake = RecordsFaker(fake_data_df, local="en_US")
data_generator = PresidioDataGenerator(
custom_faker=fake, lower_case_ratio=0
)
provider_list = [HospitalProvider, IpAddressProvider,NationalityProvider, AgeProvider, AddressProviderNew, PhoneNumberProviderNew, OrganizationProvider]
for provider in provider_list:
fake.add_provider(provider)
template = "My name is {{name}} and I [travel] to the factory"
fake_records = data_generator.generate_fake_data(
templates=[template], n_samples=1
)
list(fake_records)
Returns:
AttributeError: Failed to generate fake data based on template "My name is {{name}} and I {{travel}} to the factory".You might ?need to add a new Faker provider! Unknown formatter 'travel'
The text was updated successfully, but these errors were encountered:
It is by design (as the previous version used square brackets and we wanted to have some backward compatibility, but I don't see an issue with removing this, especially if it causes issues with generated templates.
Templates which contain square brackets fail on generating new fake data. Square brackets are converted to curly brackets to be treated as entities i.e -> "{{entity}}". Method
_prep_templates
responsible for the replacement.Is this the desired behavior?
How to reproduce the error:
Returns:
The text was updated successfully, but these errors were encountered: