Skip to content

refactor: read Excel with openpyxl and drop pandas - #57

Merged
PPeitsch merged 1 commit into
mainfrom
refactor/drop-pandas
Oct 3, 2026
Merged

PPeitsch merged 1 commit into
mainfrom
refactor/drop-pandas

Conversation

@PPeitsch

@PPeitsch PPeitsch commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Review item M3.

  • ExcelImporter reads .xlsx with openpyxl (already a dependency) instead of pandas. pandas and pandas-stubs leave the requirements: smaller install and Docker image.
  • Header detection moves to app/services/importer/columns.py and is shared with the PDF importer. The Excel import had the same substring bug fixed for PDF in fix: PDF import header matching; dependency and import cleanup #55 ("Login method" taken as the entry column); now both match whole words.
  • .xls is no longer accepted: pandas needed xlrd to read it, which was never installed, so those uploads always failed. The settings text and the Spanish catalog say xlsx only.

Tests: the Excel tests build workbooks with openpyxl; new tests for time cells, whole-word headers and .xls rejected. Also checked end to end through POST /import/ with a real .xlsx (date and time cells) and a .xls.

- ExcelImporter reads .xlsx with openpyxl; pandas and pandas-stubs are
  gone (review M3).
- Column detection shared with the PDF importer (whole words), which
  fixes the same substring bug in the Excel import.
- .xls is no longer offered: it never worked without xlrd.
@PPeitsch
PPeitsch merged commit c56d817 into main Oct 3, 2026
2 checks passed
@PPeitsch
PPeitsch deleted the refactor/drop-pandas branch October 3, 2026 09:31
@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
app/routes/import_log.py 91.71% <100.00%> (ø)
app/services/importer/columns.py 100.00% <100.00%> (ø)
app/services/importer/excel_importer.py 100.00% <100.00%> (ø)
app/services/importer/factory.py 100.00% <ø> (ø)
app/services/importer/pdf_importer.py 94.73% <100.00%> (-0.39%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant