-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
Change all instances of eval to ast.literal_eval for security reasons.
This change bypasses bandit check. See comments in issue 23
Not part of this PR.
Not part of this PR.
Not part of this PR.
Not part of this PR.
This comment has been minimized.
This comment has been minimized.
Ok.. I was just closing outdated and made the issue. Wasn't sure if we were good to go. |
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.
Thank you for your continued work. I have some suggestions based on other changes you've made. Additionally there are still unresolved elements of my last review that I have commented on again.
src/pe_reports/report_generator.py
Outdated
"/Users/schmelzs/Repos/PE_Report_Scripts/pe-reports_v1.0/pe-reports/src/pe_reports/org_names.json" | ||
) | ||
names_obj = json.load(f) | ||
names_obj = load_customers() |
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 is still no check that there is a problem with the returned value from load_customers()
. If there is a problem accessing org_names.json
you currently output a log message, return a None
, and then in
pe-reports/src/pe_reports/report_generator.py
Line 333 in 8f98208
agencies.append(names_obj[folder_name][0]) |
you immediately try and access the result without verifying it is a non-empty dictionary.
src/pe_reports/report_generator.py
Outdated
logging.error(f"The output directory cannot be created. {err}") | ||
return 0 |
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.
Those changes need to be made here as well. This logging message still does not accurately reflect the exception you are catching and it should return 1
to indicate an error.
print("") | ||
return 1 | ||
return 0 |
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.
That does not fix the problem here. This should still return a 1
to indicate an error state.
Co-authored-by: Nick M. <50747025+mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick M. <50747025+mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick M. <50747025+mcdonnnj@users.noreply.github.com>
This reverts commit 9d12e91.
209fce0
to
9d12e91
Compare
@mcdonnnj , @schmelz-ctr |
@cduhn17 if to imply it is not an error but more of a check, can we then remove traceback arg Code:
|
@mcdonnnj, Although we are going to sunset this version, I was hoping we could at least close out this last pr as it will allow for this version to pass checks. It also leaves us with working scripts in the event we need to revisit this code. |
@schmelz21 This remains unresolved. As shown below the pe-reports/src/pe_reports/report_generator.py Lines 328 to 332 in 7115dd4
|
@mcdonnnj, appreciate the quick response and apologies for the miss... circling in @cduhn17 to review and will get back with updates. |
@schmelz21 , @mcdonnnj pe-reports/src/pe_reports/report_generator.py Lines 65 to 73 in 7115dd4
|
@cduhn17 All that has been done is making sure that the function returns a dictionary no matter what. However if there is an issue accessing the file in some way it returns an empty dictionary. This will result in a |
@
I have addressed your recent request for a change to address an empty dictionary see commit e1df499 pe-reports/src/pe_reports/report_generator.py Lines 324 to 357 in e1df499
|
Closing pull-request as efforts to update the main branch have been canceled. Routines used in version 0.1.1 have been sunsetted with no future plans to update. |
🗣 Description
Specifically, to resolve pre-commit failures in
main
branch, so that new pull request are successful with GitHub checks.💭 Motivation and context
Due to the inclusion of command-line updates, and new code pertaining to
setup.py install
requirements, previous tests developed were failing. The following coincide with resolving issues #7. #8 and Pull Request #31 - will allow for tests to pass.Primary Updates:
🧪 Testing
python3 setup.py install
pytest tests/test_pe_reports.py
pre-commit run --all-files
pe-reports $(date "+%Y-%m-%d") data/ output/ --db-creds-file=cyhy_connect/
✅ Checklist
to reflect the changes in this PR.