-
Notifications
You must be signed in to change notification settings - Fork 10
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
Data Hub Test Data - Investment Project Generator #5393
Data Hub Test Data - Investment Project Generator #5393
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## firebreak/data-hub-test-data #5393 +/- ##
================================================================
- Coverage 96.40% 96.40% -0.01%
================================================================
Files 939 939
Lines 22334 22334
Branches 2003 2003
================================================================
- Hits 21532 21530 -2
- Misses 655 656 +1
- Partials 147 148 +1 ☔ View full report in Codecov by Sentry. |
# Handle case when requested number is too small | ||
if number_of_companies < 10: | ||
for adviser in advisers[:number_of_companies]: | ||
CompanyFactory( | ||
created_by=adviser, | ||
modified_by=adviser, | ||
) | ||
print(f'Generated {number_of_companies} companies') # noqa | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should/could this be refactored into a function to bring down the size of the generate_companies one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, there is some refactoring opportunity here. What I will do is merge in this PR and raise a subsequent one with a number of refactors, including this suggestion, to keep things clearer.
982805b
to
9b50190
Compare
da4994b
to
601d541
Compare
Description of change
This PR ports over the existing adviser and company generators to a new
datagen.py
script (with the intention to replace thedata_generator.py
script in a subsequent PR.It also adds a generator for invesmtnent projects.
Checklist
Has this branch been rebased on top of the current
main
branch?Explanation
The branch should not be stale or have conflicts at the time reviews are requested.
Is the CircleCI build passing?
General points
Other things to check
fixtures/test_data.yaml
is maintained when updating modelsSee docs/CONTRIBUTING.md for more guidelines.