Skip to content

Commit

Permalink
Fixed quoting so commas aren't parsed in the csv
Browse files Browse the repository at this point in the history
  • Loading branch information
jcadam14 committed Jun 21, 2024
1 parent 523658e commit d8e1609
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/regtech_data_validator/data_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def df_to_download(df: pd.DataFrame, warning_count: int = 0, error_count: int =
error_type = "warnings"

if total_errors and total_errors > max_errors:
header += f'"Your register contains {total_errors} {error_type}, however, only {max_errors} records are displayed in this report. To see additional {error_type}, correct the listed records, and upload a new file".\n'
header += f'"Your register contains {total_errors} {error_type}, however, only {max_errors} records are displayed in this report. To see additional {error_type}, correct the listed records, and upload a new file."\n'

csv_data = header + total_csv
return csv_data
Expand Down
2 changes: 1 addition & 1 deletion tests/test_output_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def test_download_max_message_csv(self):
expected_output = dedent(
"""
validation_type,validation_id,validation_name,row,unique_identifier,fig_link,validation_description,field_1,value_1,field_2,value_2
Your register contains 6 errors and warnings, however, only 3 records are displayed in this report. To see additional errors and warnings, correct the listed records, and upload a new file.
"Your register contains 6 errors and warnings, however, only 3 records are displayed in this report. To see additional errors and warnings, correct the listed records, and upload a new file."
"Error","E2008","amount_approved.conditional_field_conflict",4,"12345678901234567891","https://www.consumerfinance.gov/data-research/small-business-lending/filing-instructions-guide/2024-guide/#4.2.7","* When 'action taken' does **not** equal 1 (originated) or
2 (approved but not accepted), 'amount approved or originated' must be blank.
* When 'action taken' equals 1 or 2, 'amount approved or originated' must **not** be blank.
Expand Down

0 comments on commit d8e1609

Please sign in to comment.