-
Notifications
You must be signed in to change notification settings - Fork 4
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
3205 reparse command refactor #3361
Conversation
…TANF-app into 3205-reparse-command-refactor
@@ -1,6 +1,4 @@ | |||
# Base Docker compose for all environments | |||
version: "3.4" |
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.
this is depreciated
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.
Working as expected! One minor organization comment
delete_associated_models, | ||
count_total_num_records, | ||
calculate_timeout, | ||
handle_datafiles, |
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.
does it make sense to just have all these functions in the reparse.py
file?
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 like the idea of that as well
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.
The idea was to have a cleaner reparse file while also we can re-use some of these functions if needed. However, for some of these functions it might make sense to move them to reparse, for example handle_datafile is specific to reparse
) | ||
|
||
is_sequential = assert_sequential_execution(log_context) | ||
should_exit(not is_sequential) |
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 we update this to raise an exception/return an error to the user so that they know why the reparse didn't happen? Even writing to the console would be a start.
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.
Also, can we move this to the very beginning of the function to avoid unnecessary computation if we arent sequential?
fiscal_quarter = None | ||
fiscal_year = None | ||
all_reparse = False | ||
new_indices = False |
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.
In a future ticket, could we deduce these fields from the selected datafiles?
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, I will leave a todo
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3361 +/- ##
===========================================
- Coverage 91.15% 90.66% -0.50%
===========================================
Files 308 310 +2
Lines 8832 8899 +67
Branches 670 674 +4
===========================================
+ Hits 8051 8068 +17
- Misses 654 704 +50
Partials 127 127
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
return True | ||
|
||
|
||
def should_exit(condition): |
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.
This should be needed after the management command is removed
@ADPennington Fixed the association with meta model id, also added datetime at the end of filename. But can definitely remove it. With datetime, we also have a timestamp for the backup filename. |
@elipe17 @andrew-jameson @jtimpe : I re-requested your review on this since I had changed the way backup filename is assigned. There was an error for some of backup filenames not getting Meta id and add None to backup filename |
raise Exception(f"Sequential execution required for selected file ids: {selected_file_ids}") | ||
meta_model.save() | ||
# Backup the Postgres DB | ||
backup_file_name += f"_rpv{meta_model.pk}_{datetime.datetime.now().strftime('%d-%M-%Y-%H%M%s')}.pg" |
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.
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.
fixed the issue with minutes/month, but it is not possible to add colon since it is setting the filename. However, I did separate them with '-'
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.
Quick change needed for backup filename
Blocked on QASP review until review of #3440 completes |
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.
LGTM 🚀 thanks @raftmsohani
Summary of Changes
Pull request closes #3205 _
Moved all the utility functions to utilize.py, moved frontend reparse command to a separate function and cleaned up clean_and_reparse management command.
How to Test
Follow steps below:
Deliverables
More details on how deliverables herein are assessed included here.
Deliverable 1: Accepted Features
Checklist of ACs:
lfrohlich
and/oradpennington
confirmed that ACs are met.Deliverable 2: Tested Code
CodeCov Report
comment in PR)CodeCov Report
comment in PR)Deliverable 3: Properly Styled Code
Deliverable 4: Accessible
iamjolly
andttran-hub
using Accessibility Insights reveal any errors introduced in this PR?Deliverable 5: Deployed
Deliverable 6: Documented
Deliverable 7: Secure
Deliverable 8: User Research
Research product(s) clearly articulate(s):