Skip to content

fix(mimic-iii): load plain CSV in sqlite import.py (prefer .csv.gz) - #2149

Open
Chessing234 wants to merge 5 commits into
MIT-LCP:mainfrom
Chessing234:fix/sqlite-prefer-csv-gz
Open

fix(mimic-iii): load plain CSV in sqlite import.py (prefer .csv.gz)#2149
Chessing234 wants to merge 5 commits into
MIT-LCP:mainfrom
Chessing234:fix/sqlite-prefer-csv-gz

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • Split from fix: load paths, imports, transpile, and CI permissions #2128 per review: MIMIC-III import.py now discovers plain .csv as well as .csv.gz, preferring gzip when both exist for the same table (parity with import.sh).
  • Lazy-import pandas so the discovery helpers are unit-testable without a data stack.
  • Add tests/test_mimic_iii_sqlite_import.py and a PR unit-tests workflow so CI verifies the behavior.

Test plan

  • pytest tests/test_mimic_iii_sqlite_import.py -q
  • Place demo .csv files beside import.py and confirm tables load without editing the script
  • When both ADMISSIONS.csv and ADMISSIONS.csv.gz exist, confirm the gzip path is used

Made with Cursor

Chessing234 and others added 5 commits July 31, 2026 15:09
Use literal suffix stripping so table names are derived from .csv / .csv.gz
paths without the historical str.strip class of bugs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pin literal suffix stripping and .csv.gz preference so the loader stays
aligned with import.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
Gives the CSV discovery helpers a cheap, always-on check (requested when
this change was reviewed out of a larger infra PR).

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the outdated instruction to edit the script when files are uncompressed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the always-on pytest job discoverable next to the SQLFluff notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
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