Repository navigation
fix: use the filter key in is_relevant instead of always matching type - #93
Merged
Merged
Conversation
Filters were all compared against event["type"]["name"], so filtering on any other attribute (e.g. player) silently matched nothing. Closes #81 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| Secrets | View in Orca |
lwoodblake
self-requested a review
October 20, 2026 15:32
lwoodblake
approved these changes
Oct 20, 2026
lwoodblake
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this fix. Tests cover relevant situations and tests pass.
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.
Closes #81
Problem
helpers.is_relevantcompared every filter value againstevent["type"]["name"]and never used the key, sosb.events(match_id, filters={"player": "Lionel Messi"})silently matched nothing.Change
is_relevantnow looks upevent[key]. Dict attributes (type,player,team, ...) are compared byname; scalar attributes (e.g.minute) are compared directly.filters={"type": ...}behaves as before.tests/statsbombpy_test/test_helpers.py.Notes
The issue also suggested rejecting unsupported keys with a validation error; I went with filtering by the given key instead. Happy to add validation as a follow-up if preferred.
🤖 Generated with Claude Code