fix: adapt parser to new Blizzard hero stats response shape#415
Merged
TeKrop merged 1 commit intoMay 25, 2026
Merged
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdapt the hero stats parser to Blizzard’s new File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider handling both the old and new response shapes (top-level
selected/ratesvs nested underrates) so that the parser remains backward compatible and more resilient to partial rollouts or future changes. - Instead of indexing
json_data["rates"]directly, consider using a small validation step that raisesParserBlizzardErrorwith a clear message when the expectedrateswrapper is missing, rather than letting aKeyErrorpropagate.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider handling both the old and new response shapes (top-level `selected`/`rates` vs nested under `rates`) so that the parser remains backward compatible and more resilient to partial rollouts or future changes.
- Instead of indexing `json_data["rates"]` directly, consider using a small validation step that raises `ParserBlizzardError` with a clear message when the expected `rates` wrapper is missing, rather than letting a `KeyError` propagate.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Owner
|
@xsmyile Thank you for the fix 🙏 |
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.



Blizzard wrapped the
/en-us/rates/data/payload under a top-levelratesobject around 2026-05-12 (selected,ratesandextremanow nested inside it), which madeparse_hero_stats_jsonraiseKeyError: 'selected'on every/heroes/statscall. This patch reads the nested payload and updates the test fixture to match.Summary by Sourcery
Adapt hero stats parser to the updated Blizzard rates API response shape.
Bug Fixes:
Tests: