BDMS-468: Preserve legacy empty strings in NMA transfer pipelines#390
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modifies NMA transfer pipelines to preserve empty strings from legacy CSV sources instead of converting them to NULL values. The changes ensure that empty-string values in string fields are retained during migration while blank strings in numeric/date fields are still correctly converted to NULL.
Changes:
- Added
keep_default_na=Falseparameter to CSV reading across multiple transfer modules - Implemented
is_blank()helper functions and blank-aware numeric/date parsing to differentiate between empty strings (preserved for string fields) and blanks that should become NULL for non-string fields - Added comprehensive unit tests to verify empty string preservation for all affected transfer modules
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| transfers/weather_data.py | Added keep_default_na=False to CSV reading |
| transfers/surface_water_data.py | Added keep_default_na=False and blank-safe float/date parsing |
| transfers/radionuclides.py | Added keep_default_na=False and blank-safe numeric/date parsing |
| transfers/minor_trace_chemistry_transfer.py | Added keep_default_na=False and blank-safe float/date parsing |
| transfers/major_chemistry.py | Added keep_default_na=False and blank-safe numeric/date parsing |
| transfers/hydraulicsdata.py | Added keep_default_na=False and blank-safe numeric parsing with new as_float helper |
| transfers/chemistry_sampleinfo.py | Added keep_default_na=False and blank-safe date parsing |
| tests/test_transfer_preserve_empty_strings.py | New test file verifying empty string preservation across all transfer modules |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e96c19694c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
chasetmartin
left a comment
There was a problem hiding this comment.
Makes sense to me for all of these nma 1:1 transfers.
Why
This PR addresses the following problem / context:
How
Implementation summary - the following was changed / added / removed:
Notes
Any special considerations, workarounds, or follow-up work to note?