fix(ingestion): handle missing experience section in resume parser - #1030
Open
Unheat wants to merge 5 commits into
Open
fix(ingestion): handle missing experience section in resume parser#1030Unheat wants to merge 5 commits into
Unheat wants to merge 5 commits into
Conversation
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.
Summary
This PR fixes an unhandled
IndexErrorcrash inResumeParserwhen processing resumes belonging to candidates or new graduates who have no prior formal work experience. Safe section extraction and default empty list fallbacks have been introduced to ensure experience-free resumes are ingested gracefully without crashing the ingestion pipeline.Issue
Closes #1
Changes
_detect_sections()iningestion/parsers/resume_parser.pyto correctly recognize section headers with leading whitespace and markdown#heading markers._strip_markdown()heading regex (^\s*#+\s*) to handle indented markdown headings properly.extract_sections()method toResumeParserwith default empty list[]fallbacks for all standard section headers (SECTION_HEADERS), preventingIndexErrororKeyErrorwhen accessing missing section entries likesections['experience']._parse_pdf()(raise ... from e) to adhere to Python best practices.test_extract_sections_no_experiencetotests/unit/test_resume_parser.py.Testing
make test-unit/ pytest passes 11/11 tests intest_resume_parser.py)make test-integration)make lint/ ruff check)make typecheck/ mypy)Notes for Reviewers
tests/unit/test_resume_parser.pypass cleanly with 100% success.test_tech_detector.py); confirmed that these changes introduce no new failures and do not affect unrelated components.