Skip to content

Conversation

@jirhiker
Copy link
Member

Built out legacy MajorChemistry end‑to‑end and tightened transfer ordering/logging to respect dependencies on ChemistrySampleInfo.

What changed

  • Added MajorChemistry model + relationship: db/nma_legacy.py
  • New migration for NMA_MajorChemistry (excludes SSMA_TimeStamp): alembic/versions/a7b8c9d0e1f2_create_nma_major_chemistry.py
  • New transfer + metrics wiring:
    • transfers/major_chemistry.py
    • transfers/metrics.py (major chemistry metrics)
    • transfers/transfer.py (new flag and sequencing after ChemistrySampleInfo)
  • Added tests: tests/test_major_chemistry_legacy.py
  • Updated .env / .env.example to include TRANSFER_MAJOR_CHEMISTRY

Why

  • Support the NM_Aquifer_Dev_DB MajorChemistry legacy table with consistent schema/transfer/testing patterns.
  • Ensure dependent chemistry transfers run after ChemistrySampleInfo.

Testing

  • pytest (full suite): 311 passed, 76 skipped, 6 xpassed

Copilot AI review requested due to automatic review settings January 14, 2026 22:07
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 implements end-to-end support for the legacy MajorChemistry table from NM_Aquifer_Dev_DB, including database model, migration, transfer logic, and comprehensive testing.

Changes:

  • Added NMAMajorChemistry model with relationship to ChemistrySampleInfo
  • Implemented transfer logic with dependency validation and batch processing
  • Added configuration flag and proper sequencing after ChemistrySampleInfo transfer

Reviewed changes

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

Show a summary per file
File Description
db/nma_legacy.py Adds NMAMajorChemistry model with foreign key to ChemistrySampleInfo and bidirectional relationship
alembic/versions/a7b8c9d0e1f2_create_nma_major_chemistry.py Migration to create NMA_MajorChemistry table with indexes
transfers/major_chemistry.py Transfer implementation with SamplePtID validation, batch upserts, and deduplication
transfers/transfer.py Integrates MajorChemistryTransferer with configuration flag and proper sequencing
transfers/metrics.py Adds metrics tracking for major chemistry transfers
tests/test_major_chemistry_legacy.py Comprehensive CRUD tests for NMAMajorChemistry model
.env.example Adds TRANSFER_MAJOR_CHEMISTRY configuration flag

@jirhiker jirhiker merged commit 33541ac into staging Jan 15, 2026
6 checks passed
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.

2 participants