Skip to content

Fix NMAMinorTraceChemistry volume type to match source database #379

Description

@kbighorse

Summary

The NMAMinorTraceChemistry.volume field uses Float but the source database (NM_Aquifer_Dev_DB) defines it as int. This should be changed to Integer for consistency with the source schema.

Details

File: db/nma_legacy.py:378

Current:

volume: Mapped[Optional[float]] = mapped_column(Float)

Should be:

volume: Mapped[Optional[int]] = mapped_column(Integer)

Context

  • Source database schema (AMPAPI/testing_db/create_tables.sql) defines Volume int default 0
  • All actual data values in the source CSV are integers (0, NULL, or whole numbers like 730, 420, 200)
  • NMARadionuclides already correctly uses Integer for volume
  • This change ensures consistency between both chemistry models and the source database

Implementation

Branch: fix/minor-trace-volume-int

Changes required:

  • Update model type in db/nma_legacy.py
  • Update transfer script to use _safe_int() in transfers/minor_trace_chemistry_transfer.py
  • Update tests in tests/test_nma_chemistry_lineage.py
  • Create Alembic migration to alter column type

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions