Fix coauthor_counts.py crash: KeyError 'count' from get_all_notes - #13
Open
mmurshed wants to merge 1 commit into
Open
Fix coauthor_counts.py crash: KeyError 'count' from get_all_notes#13mmurshed wants to merge 1 commit into
mmurshed wants to merge 1 commit into
Conversation
client.get_all_notes() delegates to tools.concurrent_get(), which first
fires a with_count=True, limit=1 probe and unpacks response.json()['count'].
Against api2.openreview.net the notes response for this query carries no
'count' field (observed 2026-08-05 with openreview-py 1.27.3), so the
script crashes at startup:
File ".../openreview/api/client.py", line 1024, in get_notes
return notes, response.json()['count']
KeyError: 'count'
Replace the call with plain offset pagination via client.get_notes(),
which needs no count probe. Behaviour is otherwise identical; verified
against a live author profile (returns the correct submission list).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YamLghkWSvYw1NzBhGChFf
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.
Problem
src/coauthor_counts.pycrashes at startup for (at least some) authors:client.get_all_notes()delegates totools.concurrent_get(), which first fires awith_count=True, limit=1probe and unconditionally unpacksresponse.json()['count']. Againstapi2.openreview.net, the notes response for thecontent={'authorids': ...}query returns nocountfield, so the probe raises before any submission is fetched. Observed 2026-08-05 with openreview-py 1.27.3 (current PyPI release at the time).Fix
Replace the
get_all_notes()call with a small local helper that paginates via plainclient.get_notes(offset=..., limit=1000, ...)— no count probe needed; the loop terminates when a batch comes back short. No other behaviour changes.Verification
Run against a live author profile with one 2026 TMLR submission; before the patch the script crashes as above, after it prints the expected output:
With the quota policy now counting desk-rejected and withdrawn submissions, this script is the only self-serve way for authors to audit their year — worth keeping runnable on the current openreview-py.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YamLghkWSvYw1NzBhGChFf