Skip to content

BDMS-158: Company to Organization Mapping & Other Updates#211

Merged
jirhiker merged 20 commits into
stagingfrom
jab-owners-organizations
Oct 29, 2025
Merged

BDMS-158: Company to Organization Mapping & Other Updates#211
jirhiker merged 20 commits into
stagingfrom
jab-owners-organizations

Conversation

@jacob-a-brown

Copy link
Copy Markdown
Contributor

Why

This PR addresses the following problem / context:

  • records from OwnersData.Company need be mapped to organizations in the lexicon table to enable the transfer to occur
  • time.tzset() only works on Unix systems, preventing cross-platform compatability

How

Implementation summary - the following was changed / added / removed:

  • map companies to organizations
  • add organizations to lexicon
  • comment out time.tzset() in tests/__init__.py

Notes

Any special considerations, workarounds, or follow-up work to note?

  • To prevent duplicate contacts I first if the contact exists in transfers/waterlevels_transfer.py. This can be kind of slow. I didn't run into any of these situations but wanted to account for the possibility. Is this necessary?
  • Ethan identified MR as Madeline Richards, who was a graduate student at NMT
  • Ethan and I tried to consolidate as much as possible, but he also requested departments be distinct from the entity if they both exist (e.g. City of Santa Fe/City of Santa Fe WWTP or BLM/BLM Taos Office)

@codecov-commenter

codecov-commenter commented Oct 28, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
transfers/contact_transfer.py 41.66% 7 Missing ⚠️
Files with missing lines Coverage Δ
db/contact.py 100.00% <100.00%> (ø)
tests/__init__.py 100.00% <ø> (ø)
transfers/contact_transfer.py 11.80% <41.66%> (ø)

@kbighorse

Copy link
Copy Markdown
Contributor

suggestion: consider zoneinfo in place of tzset. We use python 3.13, so it should work.

Comment thread transfers/waterlevels_transfer.py Outdated
Comment thread transfers/data/owners_organization_mapper.json Outdated
Comment thread transfers/contact_transfer.py Outdated
Comment thread transfers/contact_transfer.py Outdated
Comment thread transfers/contact_transfer.py Outdated
Comment thread .pre-commit-config.yaml Outdated
@jacob-a-brown

Copy link
Copy Markdown
Contributor Author

suggestion: consider zoneinfo in place of tzset. We use python 3.13, so it should work.

@kbighorse: according to the docs

ZoneInfo is a concrete implementation of the datetime.tzinfo abstract base class, and is intended to be attached to tzinfo, either via the constructor, the datetime.replace method or datetime.astimezone

You already set the timezones to UTC via .astimezone(timezone.utc) in the tests. Do you recommend using zoneinfo instead of timezone.utc?

@jirhiker jirhiker merged commit f40cad5 into staging Oct 29, 2025
6 checks passed
@TylerAdamMartinez TylerAdamMartinez deleted the jab-owners-organizations branch February 5, 2026 18:09
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.

4 participants