Skip to content

fix: resolve KeyError in quality_assurance.load_venues#689

Open
AmSach wants to merge 1 commit into
ARBML:mainfrom
AmSach:fix/qa-load-venues-keyerror
Open

fix: resolve KeyError in quality_assurance.load_venues#689
AmSach wants to merge 1 commit into
ARBML:mainfrom
AmSach:fix/qa-load-venues-keyerror

Conversation

@AmSach

@AmSach AmSach commented Jul 5, 2026

Copy link
Copy Markdown

Summary

quality_assurance.py crashes on startup with KeyError: 'venues' because load_venues() expects a top-level venues key that doesn't exist in venues.json.

The actual file is a flat dict keyed by canonical venue title, where each value has {name, type, aliases} (no title field). The lookup loop then accessed entry[title], which would also KeyError.

Changes

  1. load_venues() now returns the parsed JSON object directly instead of accessing a non-existent venues key.
  2. The title lookup loop iterates venues.items() and treats the dict key as the canonical title, merging it into the entry so downstream entry[title] lookups still work.

Verification

  • python3 quality_assurance.py now runs to completion and scans 1,118 datasets successfully, reporting 23 real issues (0 venue, 0 subset, 1 host, 14 public-derived, 8 authors).
  • Pre-fix, the script crashed immediately at load_venues() before scanning any file.

— Sent via @AmSach bot

venues.json is a flat dict keyed by canonical venue title (no 'venues'
wrapper key), but load_venues() returned data['venues'], which raised
KeyError immediately. main() also iterated entries expecting each to
have a 'title' field, when the title is actually the dict key.

- load_venues() now returns the parsed dict directly.
- main() iterates .items() and injects the canonical title into each
  entry under a 'title' key so the existing check_venue_reference
  logic keeps working without further changes.
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.

1 participant