Skip to content

fix(ingestion): handle missing experience section in resume parser - #1030

Open
Unheat wants to merge 5 commits into
ascherj:mainfrom
Unheat:fix/1-resume-parser-index-error
Open

fix(ingestion): handle missing experience section in resume parser#1030
Unheat wants to merge 5 commits into
ascherj:mainfrom
Unheat:fix/1-resume-parser-index-error

Conversation

@Unheat

@Unheat Unheat commented Aug 11, 2026

Copy link
Copy Markdown

Summary

This PR fixes an unhandled IndexError crash in ResumeParser when 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

  • Updated regex patterns in _detect_sections() in ingestion/parsers/resume_parser.py to correctly recognize section headers with leading whitespace and markdown # heading markers.
  • Fixed _strip_markdown() heading regex (^\s*#+\s*) to handle indented markdown headings properly.
  • Added extract_sections() method to ResumeParser with default empty list [] fallbacks for all standard section headers (SECTION_HEADERS), preventing IndexError or KeyError when accessing missing section entries like sections['experience'].
  • Fixed exception chaining in _parse_pdf() (raise ... from e) to adhere to Python best practices.
  • Added unit test test_extract_sections_no_experience to tests/unit/test_resume_parser.py.

Testing

  • Unit tests pass (make test-unit / pytest passes 11/11 tests in test_resume_parser.py)
  • Integration tests pass (make test-integration)
  • Linter passes (make lint / ruff check)
  • Type checker passes (make typecheck / mypy)
  • New/updated tests cover the changes

Notes for Reviewers

  • All 11 unit tests in tests/unit/test_resume_parser.py pass cleanly with 100% success.
  • Noted pre-existing test failures in unrelated modules (e.g. test_tech_detector.py); confirmed that these changes introduce no new failures and do not affect unrelated components.

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.

Resume parser raises IndexError on resumes with no work experience section

1 participant