Skip to content

Commit

Permalink
Updated to write out report data from validator
Browse files Browse the repository at this point in the history
  • Loading branch information
jcadam14 committed Nov 7, 2024
1 parent 057e724 commit d53a32a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/sbl_filing_api/services/submission_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ async def validate_and_update_submission(
else:
submission.state = SubmissionState.VALIDATION_WITH_WARNINGS

report_path = generate_file_path(period_code, lei, f"{submission.id}_report")
submission_report = df_to_download(
final_df,
warning_count=sum([r.warning_counts.total_count for r in all_findings]),
error_count=sum([r.error_counts.total_count for r in all_findings]),
max_errors=settings.max_validation_errors,
)

df_to_download(final_df, report_path)
upload_to_storage(period_code, lei, str(submission.id) + REPORT_QUALIFIER, submission_report)

# upload_to_storage(
# period_code, lei, str(submission.id) + REPORT_QUALIFIER, submission_report.encode("utf-8")
# )
if not exec_check["continue"]:
log.warning(f"Submission {submission.id} is expired, will not be updating final state with results.")
return
Expand Down
2 changes: 1 addition & 1 deletion tests/services/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def build_validation_results_mock(mocker: MockerFixture, validate_submission_moc
@pytest.fixture(scope="function")
def df_to_download_mock(mocker: MockerFixture):
mock_download_formatting = mocker.patch("sbl_filing_api.services.submission_processor.df_to_download")
mock_download_formatting.return_value = None
mock_download_formatting.return_value = b"\x01"

0 comments on commit d53a32a

Please sign in to comment.