New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear on how to use Format.toCsv(FakeCollection<T> collection) #278
Comments
No worries at all. I'm happy to help you more, but as a starting point, did you have a look at this documentation? https://www.datafaker.net/documentation/file-formats/#csv If so, is there anything specially unclear? |
The documentation is a bit unclear on how to use a collection builder for generating CSV files. An example like the test shown here would have been nice:
I've basically done the following right now:
I'd be willing to submit a PR if you'd like. Three PRs, actually. One explaining how to use a collection builder for generating CSV files, another one for an end-to-end example on how to compare the custom generated entities with domain objects. The third PR would have a certain nullRate to inject errors. What do you think? I've also noticed that generating UUIDs ignores the Faker's random seed, thus generating a "truly" random UUID each time. What do you think of changing that? A simple hack could be to simply call UUID.nameUUIDFromBytes() and passing a randomly generated number each time, using the RandomService / user provided random seed. Edit:
|
I really like all your ideas, and I'd accept any PR if you'd be willing to submit one. Thanks for the great feedback, that's really useful! |
No problem, will do. Would you like me to create new issues for all the things I've just mentioned or shall I simply reference this issue in each PR? |
just fyi: there is also a separate doc about collections https://www.datafaker.net/documentation/collections/ |
Thanks again! And I have no preference, whatever works best for you. |
Basically, yes. |
I can't think of another good documentation example and the uuid randomness issue has been fixed, I'll close this issue. |
This is neither a bug nor a feature request, that's why I'm writing in free form, I hope that's okay.
I'm trying to do the following:
How could one go about doing this? I saw that there is a Format.toCSV() overload that accepts a collection but it's unclear to me how you'd use that method.
The text was updated successfully, but these errors were encountered: