Skip to content

fix: bugs from 7f6c3cda#177

Closed
nikbpetrov wants to merge 2 commits into
forecastingresearch:mainfrom
nikbpetrov:resolve-fix2
Closed

fix: bugs from 7f6c3cda#177
nikbpetrov wants to merge 2 commits into
forecastingresearch:mainfrom
nikbpetrov:resolve-fix2

Conversation

@nikbpetrov
Copy link
Copy Markdown
Collaborator

just setting filename to hash_mapping.json causes gcp.storage.upload to correctly upload the file to the remote

the 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.json and {acled,wikipedia}/hash_mapping_{acled,wikipedia}.json exist in the buckets, and are identical. If there was a hashing to be written, then the files would diverge - wikipedia would silently set resolution to nan, while acled would have blown up

@nikbpetrov nikbpetrov requested a review from houtanb April 20, 2026 17:14
@nikbpetrov
Copy link
Copy Markdown
Collaborator Author

Note that tests pass here. If you use the testsuite:
fbtest test --pr 177 --only source.wikipedia.update --only source.acled.update

you will notice that the current main branch code updates {acled,wikipedia}/hash_mapping_{acled,wikipedia}.json files, while the new code (from this PR) updates the correct {acled,wikipedia}/hash_mapping.json on the buckets

@houtanb
Copy link
Copy Markdown
Member

houtanb commented Apr 22, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

@houtanb
Copy link
Copy Markdown
Member

houtanb commented Apr 22, 2026

@claude review

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. src/orchestration/_io.py: adds filename="hash_mapping.json" to the gcp.storage.upload() call in upload_hash_mapping() so that the file lands at {source}/hash_mapping.json rather than the incorrect {source}/hash_mapping_{source}.json.
  2. src/sources/acled.py: adds an is None guard after _id_unhash(mid) so that a missing hash mapping entry logs and returns np.nan rather than raising TypeError from **None unpacking.

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.

@houtanb
Copy link
Copy Markdown
Member

houtanb commented Apr 27, 2026

merged in 690904b and 1d576e7

@houtanb houtanb closed this Apr 27, 2026
@nikbpetrov nikbpetrov deleted the resolve-fix2 branch May 16, 2026 09:34
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.

2 participants