Skip to content

Conversation

@kbighorse
Copy link
Contributor

@kbighorse kbighorse commented Jan 14, 2026

Summary

  • Change NMAMinorTraceChemistry.volume field type from Float to Integer to match source database schema

Details

The source database (NM_Aquifer_Dev_DB) defines the Volume column as int default 0. All actual data values are integers. This change aligns the model with the source schema for consistency.

Changes

  • db/nma_legacy.py: Update volume field type
  • transfers/minor_trace_chemistry_transfer.py: Add _safe_int() helper, use for volume
  • tests/test_nma_chemistry_lineage.py: Update test values from 500.0 to 500
  • alembic/versions/g4a5b6c7d8e9_*: Migration to alter column type

Test plan

  • Run existing tests for NMAMinorTraceChemistry
  • Verify migration runs successfully on staging database
  • Confirm transfer script handles integer conversion correctly

Closes #379

🤖 Generated with Claude Code

Update volume field type to match source database schema (NM_Aquifer_Dev_DB).

Changes:
- Update model type in db/nma_legacy.py
- Add _safe_int() helper in transfer script
- Update tests to use integer values
- Add Alembic migration to alter column type

Closes #379

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 14, 2026 19:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the NMAMinorTraceChemistry.volume field with the source database schema by changing its type from Float to Integer, as the source database defines this column as int and all actual data values are integers.

Changes:

  • Updated model field type from Float to Integer
  • Added integer conversion helper method in transfer script
  • Updated test assertions to use integer values

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
db/nma_legacy.py Changed volume field type from Float to Integer
transfers/minor_trace_chemistry_transfer.py Added _safe_int() helper and updated volume conversion from float to int
tests/test_nma_chemistry_lineage.py Updated test values from 500.0 to 500 to match new Integer type
alembic/versions/g4a5b6c7d8e9_change_minor_trace_volume_to_int.py Added migration to alter volume column type with proper upgrade/downgrade logic

@kbighorse kbighorse requested a review from Copilot January 14, 2026 19:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@kbighorse kbighorse requested a review from ksmuczynski January 14, 2026 19:20
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.

Fix NMAMinorTraceChemistry volume type to match source database

2 participants