fix: enhance name generation logic to use OwnerKey as fallback#534
Conversation
…date transfer method to parallel execution
There was a problem hiding this comment.
Pull request overview
This PR updates the contact transfer to generate a fallback contact name using OwnerKey when both first/last name and organization are missing, and adjusts an integration test to run well transfers via the parallel execution path.
Changes:
- Use
_safe_make_name(...)in_add_first_contactto fall back toOwnerKeyfor missing name/org. - Add
_safe_make_namehelper with warning logging for missing identifiers. - Update the multi-well contact transfer test to call
WellTransferer.transfer_parallel().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
transfers/contact_transfer.py |
Adds OwnerKey-based fallback naming via _safe_make_name and uses it for primary contact creation. |
tests/transfers/test_contact_with_multiple_wells.py |
Switches the well transfer step in the test helper to run via transfer_parallel(). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5f84ad246
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…k and add deduplication handling
Summary
This PR updates contact transfer behavior to improve name generation robustness and transfer performance.
Changes
OwnerKeyas a fallback when primary name fields are unavailable./Users/jross/Programming/DIG/OcotilloAPI/tests/transfers/test_contact_with_multiple_wells.py/Users/jross/Programming/DIG/OcotilloAPI/transfers/contact_transfer.pyWhy
OwnerKeyfallback prevents dropped/empty contact names.Validation
tests/transfers/test_contact_with_multiple_wells.pypass:test_multiple_wellstest_owner_comment_creates_notes_for_primary_onlytest_owner_comment_absent_skips_notesRisk / Impact