Add Client.resolve_activities, concurrent batch name resolution - #225
Merged
Conversation
ccomb
force-pushed
the
pyvolca-resolve-activities
branch
2 times, most recently
from
July 15, 2026 21:28
0b4c7ef to
611cfe8
Compare
Scripts kept hand-rolling the same two patterns to map names to process ids: downloading the whole database to build a lookup dict, and per-name thread pools over search_activities. One helper replaces both: one search per unique name, fanned out over a thread pool, with a total result mapping so a name that resolves to nothing is an empty list rather than a silently missing key. When exact=True the client re-checks equality (same casefold rule as the engine) on the returned matches: engines released before the product filter honored exact= return substring matches, and a near-miss must not resolve silently.
ccomb
force-pushed
the
pyvolca-resolve-activities
branch
from
July 15, 2026 21:36
611cfe8 to
4fede25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Scripts that need process ids for a list of names keep reinventing the same two workarounds: downloading the entire database (
limit=200000) to build a name→process_id dict, or hand-rolled thread pools issuing onesearch_activitiesper name.What
Client.resolve_activities(names, *, by="name"|"product", geo=, exact=True, limit=5, workers=8)resolves a batch of names concurrently and returns{name: [matches]}:[]instead of disappearing — misses stay visible.geo=or inspect the candidates.exact=Falsereturns relevance-ranked candidates, best first.With
exact=Truethe client re-checks equality on the returned matches (same casefold rule as the engine): engines whose product filter ignoresexact=return substring matches, and a near-miss must never resolve silently. A separate engine PR fixes that filter at the source.Verification
by="product", and a deduplicated batch.