Issue
What is the issue?
application/utils/spreadsheet_parsers.py:206 (function parse_export_format) calls validate_export_csv_rows(lfile), but no function by that name is defined or imported anywhere in the repository:
Found this when I was running tests for a sanity check before starting module B project.
$ git grep -n "validate_export_csv_rows"
application/utils/spreadsheet_parsers.py:206: validated_rows = validate_export_csv_rows(lfile)
Only one call site, no definition. A function with a near-identical name and matching signature/purpose does exist in the same file:
$ git grep -n "def validate_import_csv_rows"
application/utils/spreadsheet_parsers.py:138:def validate_import_csv_rows(rows: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
The call was introduced by PR #683 ("refactor(csv-import): move CSV validation into spreadsheet parser", commit 4de782b), which extracted the validator under the _import_ name but left this single caller pointing at the old/intended _export_ name. It looks like a copy-paste typo from when the helper was renamed during the refactor.
Result: any code path that invokes parse_export_format raises NameError: name 'validate_export_csv_rows' is not defined. The unit test application/tests/spreadsheet_parsers_test.py::TestParsers::test_parse_export_format fails on this every run.
Expected Behaviour
parse_export_format should validate the input CSV rows via the existing validate_import_csv_rows helper and proceed to build the CRE/standard dictionaries. The corresponding unit test should pass.
Actual Behaviour
The call raises NameError:
File "application/utils/spreadsheet_parsers.py", line 206, in parse_export_format
validated_rows = validate_export_csv_rows(lfile)
NameError: name 'validate_export_csv_rows' is not defined
make test reports test_parse_export_format as ERROR.
Steps to reproduce
-
Check out main at any commit since 4de782b.
-
Activate the project venv.
-
Run the targeted test:
FLASK_APP=cre.py flask test application.tests.spreadsheet_parsers_test
-
Observe ERROR: test_parse_export_format with the NameError traceback above.
Issue
What is the issue?
application/utils/spreadsheet_parsers.py:206(functionparse_export_format) callsvalidate_export_csv_rows(lfile), but no function by that name is defined or imported anywhere in the repository:Found this when I was running tests for a sanity check before starting module B project.
$ git grep -n "validate_export_csv_rows"
application/utils/spreadsheet_parsers.py:206: validated_rows = validate_export_csv_rows(lfile)
Only one call site, no definition. A function with a near-identical name and matching signature/purpose does exist in the same file:
$ git grep -n "def validate_import_csv_rows"
application/utils/spreadsheet_parsers.py:138:def validate_import_csv_rows(rows: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
The call was introduced by PR #683 ("refactor(csv-import): move CSV validation into spreadsheet parser", commit 4de782b), which extracted the validator under the
_import_name but left this single caller pointing at the old/intended_export_name. It looks like a copy-paste typo from when the helper was renamed during the refactor.Result: any code path that invokes
parse_export_formatraisesNameError: name 'validate_export_csv_rows' is not defined. The unit testapplication/tests/spreadsheet_parsers_test.py::TestParsers::test_parse_export_formatfails on this every run.Expected Behaviour
parse_export_formatshould validate the input CSV rows via the existingvalidate_import_csv_rowshelper and proceed to build the CRE/standard dictionaries. The corresponding unit test should pass.Actual Behaviour
The call raises
NameError:File "application/utils/spreadsheet_parsers.py", line 206, in parse_export_format
validated_rows = validate_export_csv_rows(lfile)
NameError: name 'validate_export_csv_rows' is not defined
make testreportstest_parse_export_formatasERROR.Steps to reproduce
Check out
mainat any commit since 4de782b.Activate the project venv.
Run the targeted test:
FLASK_APP=cre.py flask test application.tests.spreadsheet_parsers_test
Observe
ERROR: test_parse_export_formatwith theNameErrortraceback above.