BDMS 57: updated contact model, schema, tests, and transfer#119
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
|
jirhiker
approved these changes
Sep 3, 2025
| contact.organization is None | ||
| and contact_data.organization is None | ||
| and contact_data.name is None | ||
| ): |
Member
There was a problem hiding this comment.
this should be
if contact_data.name is None and contact_data.organization is None:
if contact.name is None:
....
elif contact.organization is None:
.... | search_vector = Column(TSVectorType("name", "role")) | ||
| search_vector = Column( | ||
| TSVectorType("name", "role", "organization", "nma_pk_owners") | ||
| ) |
Member
There was a problem hiding this comment.
We should think about whether or not we should make nma_pk_owners searchable
Contributor
Author
There was a problem hiding this comment.
That data is encoded in either the name or organization, so that may be redundant and lead to confusion... It's also not returned in any responses. I'll remove this in a PR. Should role be searchable too? That's not really unique to a particular contact (different contacts can have the same roles).
Member
There was a problem hiding this comment.
lets leave role it in for now, but i get your point. Someone probably won't search by the "role" keyword
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR addresses the following problem / context:
organizationandnma_pk_ownerswere missing from OcotilloHow
Implementation summary - the following was changed / added / removed:
organizationas a nullable string fieldnamenullable so thatorganizationcan be the primary name of a contact if that's how it's been recordedorganizationornameare null when creating or updating a contactCompanycolumn toownersdata.csvto more closely mimic NM_Aquifernma_pk_ownersfield to contact to tie records back to NM_Aquifer.nma_pk_ownersis only to be used when transferring data. It is not usable by the API.(first name or last name) and companyare skipped because there's no identifying information.OwnerKeybecome the name?Notes
Any special considerations, workarounds, or follow-up work to note?
transfers/transfer.pyto help the user know when a transfer function is being calledtransfersto the beginning of paths so that the transfer script can be called from the root directory aspython -m transfers.transferowners_transfertocontacts_transferto be consistent in style and namingownersdata.csvhasPointIDas a column. In NM_Aquifer there is an OwnerLink table to connect owners to locations. When creating the tables for the transfer will we includePointIDs in the owners data table, or should I add an OwnerLink table to mimic NM_Aquifer more closely? (and update the transfer script appropriately)