Skip to content

fix(datasource): handle CSV extensions case-insensitively - #1457

Open
Kapozux wants to merge 1 commit into
dataease:mainfrom
Kapozux:fix/csv-extension-case
Open

Kapozux wants to merge 1 commit into
dataease:mainfrom
Kapozux:fix/csv-extension-case

Conversation

@Kapozux

@Kapozux Kapozux commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #1456.

Datasource uploads accept CSV extensions case-insensitively, but the readers and the legacy upload endpoint selected the Excel parser for stored names such as orders.CSV. Use the same case-insensitive CSV check for preview, import, CSV sheet naming and the legacy upload endpoint. Keep the original filename and path so existing stored uploads work too.

Verification

  • Added eight regressions covering identical .csv, .CSV and .CsV files, an Excel workbook named sales.CSV.xlsx, and a multipart request to the legacy upload route. Five failed on the base commit. All eight pass with this change.
  • Exercised /datasource/parseExcel, /datasource/importToDb and /datasource/uploadExcel with FastAPI TestClient, test identity and a disposable PostgreSQL 17.11 database. Each suffix produced the same two preview rows, the import returned Sheet1, and both import paths persisted the expected rows.
  • Ran the CSV, upload path, import path and upload filename test files with the same environment and tests on both revisions. Base 2e81ded5 had 66 passes and 14 failures. This branch has 71 passes and 9 failures. The remaining nine are unchanged upload guard failures: seven expect a top-level filePath and two expect a different rejection detail for orders.xlsx:extra.

This branch has not been deployed

No deployments
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.

[BUG] Datasource preview and import treat uppercase CSV extensions as Excel workbooks

1 participant