lundi 25 octobre 2021

how to use dbfaker to generate non duplicate data

when I use dbfaker to make test data, I use field definition in yml file like sample below:

org_name:
      comment: 部门
      engine: choice(['人行','工行','农行','中行','建行','交行'])

when I use choice, It comes out there are duplicate org_name in test data, How can I achive the method to get non duplicate org_name in test data

random.sample function needs k to get a list result, and neither can make non duplicate data

dbfaker




Aucun commentaire:

Enregistrer un commentaire