Skip to content

fix(spreadsheet_parsers): correct function name for validating import…#903

Merged
Pa04rth merged 2 commits into
OWASP:mainfrom
manshusainishab:fix-failing-test
May 12, 2026
Merged

fix(spreadsheet_parsers): correct function name for validating import…#903
Pa04rth merged 2 commits into
OWASP:mainfrom
manshusainishab:fix-failing-test

Conversation

@manshusainishab
Copy link
Copy Markdown
Contributor

fixes #902

Description

parse_export_format at application/utils/spreadsheet_parsers.py:206 calls validate_export_csv_rows(lfile), but no such function exists anywhere in the repo — git grep finds only this single call site, with no def. The function with the intended behaviour is validate_import_csv_rows, defined in the same file at line 138, with an identical signature (List[Dict[str, Any]] -> List[Dict[str, Any]]) and the same validation purpose.

The call was introduced by #683 (commit 4de782b, "refactor(csv-import): move CSV validation into spreadsheet parser"). That refactor extracted the validator under the _import_ name and updated parse_import_format to call it, but missed updating this one call inside parse_export_format. Looks like a copy/paste typo carried over from the rename.

Effect on main: any invocation of parse_export_format raises NameError: name 'validate_export_csv_rows' is not defined, and application/tests/spreadsheet_parsers_test.py::TestParsers::test_parse_export_format fails on every run.

Fix

One line. s/validate_export_csv_rows/validate_import_csv_rows/ at application/utils/spreadsheet_parsers.py:206. No imports change, no behaviour change at the call site beyond resolving the reference, and there are no other callers (grep confirms).

Scope

Single-line change to a single file. No refactor, no rename, no new tests — the existing test_parse_export_format already covers this path and now passes.

@manshusainishab
Copy link
Copy Markdown
Contributor Author

@Pa04rth @northdpole

@Pa04rth Pa04rth self-requested a review May 12, 2026 02:59
@Pa04rth Pa04rth merged commit 89b1643 into OWASP:main May 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parse_export_format calls undefined validate_export_csv_rows, causing NameError and test failure

2 participants