BDMS-520-1-1-Cleanup-2.0#444
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances data quality tracking and handles legacy equipment field type corrections in the database migration and transfer logic.
Changes:
- Added
nma_data_qualityfield to observations to capture legacy WaterLevels DataQuality codes - Corrected
nma_WI_MicGainfield type from Integer to Boolean in deployment schema - Improved timezone handling for WaterLevels transfers to respect TimeDatum field
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| transfers/waterlevels_transfer.py | Added DataQuality mapping logic and TimeDatum-aware UTC conversion |
| transfers/sensor_transfer.py | Added boolean coercion helper for WI_MicGain field |
| tests/test_transfer_legacy_dates.py | Added test coverage for DataQuality mapping and TimeDatum handling |
| tests/test_sensor_transfer.py | Added test coverage for WI_MicGain boolean coercion |
| schemas/observation.py | Added nma_data_quality field to observation response schema |
| db/observation.py | Added nma_data_quality column to Observation model |
| db/deployment.py | Changed nma_WI_MicGain type from Integer to Boolean |
| core/lexicon.json | Updated data_quality term definitions to be more descriptive |
| alembic/versions/e123456789ab_add_observation_data_quality.py | Migration to add nma_data_quality column |
| alembic/versions/263109252fb1_add_legacy_equipment_fields.py | Updated migration to use Boolean type for WI_MicGain |
| f"{SPACE_6}Unknown DataQuality code '{dq_code}' for WaterLevels record {row.GlobalID}" | ||
| ) | ||
|
|
||
| # TODO: after sensors have been added to the database update sensor_id (or sensor) for waterlevels that come from db sensors (like e probes?) |
There was a problem hiding this comment.
Corrected spelling of 'db' to 'DB' for consistency with standard database abbreviation conventions.
| # TODO: after sensors have been added to the database update sensor_id (or sensor) for waterlevels that come from db sensors (like e probes?) | |
| # TODO: after sensors have been added to the database update sensor_id (or sensor) for waterlevels that come from DB sensors (like e probes?) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4739aa4279
ℹ️ 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".
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?