fix: resolve KeyError in quality_assurance.load_venues#689
Open
AmSach wants to merge 1 commit into
Open
Conversation
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.
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.
Summary
quality_assurance.pycrashes on startup withKeyError: 'venues'becauseload_venues()expects a top-levelvenueskey that doesn't exist invenues.json.The actual file is a flat dict keyed by canonical venue title, where each value has
{name, type, aliases}(notitlefield). The lookup loop then accessedentry[title], which would also KeyError.Changes
load_venues()now returns the parsed JSON object directly instead of accessing a non-existentvenueskey.venues.items()and treats the dict key as the canonical title, merging it into the entry so downstreamentry[title]lookups still work.Verification
python3 quality_assurance.pynow runs to completion and scans 1,118 datasets successfully, reporting 23 real issues (0 venue, 0 subset, 1 host, 14 public-derived, 8 authors).load_venues()before scanning any file.— Sent via @AmSach bot