Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors water level transducer transfer logic to handle duplicate observation blocks and improve error reporting.
Changes:
- Modified block creation to check for existing blocks before insertion
- Enhanced error logging with full stack traces
- Improved timestamp handling for deployment lookups
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| transfers/waterlevels_transducer_transfer.py | Added duplicate block detection logic and improved timestamp type handling in deployment finder |
| transfers/transfer.py | Enhanced error logging to include full stack traces |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a62b05b8f
ℹ️ 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".
| ) | ||
| if existing: | ||
| existing.comment = block.comment or existing.comment | ||
| existing.release_status = block.release_status or existing.release_status |
There was a problem hiding this comment.
Preserve existing block release_status when reusing
When a matching block already exists, this assignment overwrites existing.release_status with block.release_status. New blocks inherit ReleaseMixin’s default release status of "draft" (db/base.py), so rerunning the transfer for the same thing/parameter/time window will downgrade any previously public/private block back to draft. That’s a regression for reimports; only update release_status when it was explicitly set (or leave it unchanged for existing blocks).
Useful? React with 👍 / 👎.
Why
This PR addresses the following problem / context:
How
Implementation summary - the following was changed / added / removed:
Notes
Any special considerations, workarounds, or follow-up work to note?