fix: bugs from 7f6c3cda#177
Conversation
…dia so that acled does not blow up in case of hashing issues
|
Note that tests pass here. If you use the testsuite: you will notice that the current main branch code updates |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@claude review |
There was a problem hiding this comment.
LGTM — two minimal bug fixes (correct remote upload path + defensive None guard mirroring the wikipedia pattern).
Extended reasoning...
Overview
This PR fixes two bugs introduced in commit 7f6c3cda:
src/orchestration/_io.py: addsfilename="hash_mapping.json"to thegcp.storage.upload()call inupload_hash_mapping()so that the file lands at{source}/hash_mapping.jsonrather than the incorrect{source}/hash_mapping_{source}.json.src/sources/acled.py: adds anis Noneguard after_id_unhash(mid)so that a missing hash mapping entry logs and returnsnp.nanrather than raisingTypeErrorfrom**Noneunpacking.
Security risks
None. The changes touch internal orchestration/upload plumbing and resolution logic — no auth, crypto, permissions, or user-facing input handling.
Level of scrutiny
Low. Both changes are trivial, well-motivated, and explained in the PR description. The filename kwarg addition is a one-line mechanical correction validated by the author via fbtest (shows correct bucket paths after the fix). The is None guard mirrors an already-established pattern used for wikipedia in the sibling code path.
Other factors
The PR author confirmed tests pass and described the exact failure mode (both old/new hash_mapping files exist and are identical in their bucket, masking the bug until a divergence would have triggered an ACLED crash). Codex also reviewed and found no major issues. The bug hunting system found no issues. Changes are self-contained, reversible, and follow established patterns.
just setting
filenametohash_mapping.jsoncausesgcp.storage.uploadto correctly upload the file to the remotethe second acled guard is a consequence of codex's investigation: the only reason resolve was not blowing up in my GCP project is due to the fact that both
{acled,wikipedia}/hash_mapping.jsonand{acled,wikipedia}/hash_mapping_{acled,wikipedia}.jsonexist in the buckets, and are identical. If there was a hashing to be written, then the files would diverge - wikipedia would silently set resolution tonan, while acled would have blown up