fix: tolerate non-standard Excel formats (issue #136)#137
Open
IDKHowToCodeFR wants to merge 1 commit into
Open
fix: tolerate non-standard Excel formats (issue #136)#137IDKHowToCodeFR wants to merge 1 commit into
IDKHowToCodeFR wants to merge 1 commit into
Conversation
- Drop fully blank rows before column assignment - Add semantic column detection across header row - Fall back to longest-string heuristic when no keyword match - Add regression test with attached wellbeing-scales-list.xlsx Closes harmonydata#136
Author
|
Umm I made q mistake in my discord username it's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
"to', etc, please delete it from your pull request. If you can limit the number of files that you modify in your PR to just what is strictly necessary makes it much simpler to track the edits to the project, and also makes things easier to merge your changes if two people work on the project simultaneously and their changes have to be combined.Excel files with non-standard column headers or leading blank rows failed to parse, returning empty instruments or incorrect column mappings. The fix adds blank row stripping and keyword-based column detection before falling back to the existing positional logic. No new dependencies are introduced.
Files changed:
src/harmony/parsing/excel_parser.py— core fixtests/test_excel_tolerant.py— regression testtests/wellbeing-scales-list.xlsx— test fixture from the issueFixes #136
Type of change
Testing
Added regression test
tests/test_excel_tolerant.pyusing the exact file attached in issue #136 (wellbeing-scales-list.xlsx).To reproduce:
Full suite run:
test_convert_pdf.pyandtest_url_loader.pyare pre-existing failures requiring Java/Tika which is not installed on this machine. Neither is related to this change.Did not run harmonyapi tests locally as they require Java/Tika. The change is limited to column detection logic in
excel_parser.pyand does not alter any function signatures, return types, or the Instrument schema.uv run pytest tests/test_excel_tolerant.py -v— PASSEDTest Configuration
Checklist
requirements.txt,pyproject.tomland also in therequirements.txtin the API repodiscordapp.com/users/ifdkhowtochatfr