Skip to content

Add StatsBomb 3-2-4-1 formation mapping#553

Merged
probberechts merged 1 commit into
PySport:masterfrom
cb-jodv:fix/statsbomb-3241-formation
May 21, 2026
Merged

Add StatsBomb 3-2-4-1 formation mapping#553
probberechts merged 1 commit into
PySport:masterfrom
cb-jodv:fix/statsbomb-3241-formation

Conversation

@cb-jodv
Copy link
Copy Markdown
Contributor

@cb-jodv cb-jodv commented May 21, 2026

Summary

Add the missing StatsBomb 3241 formation mapping to FormationType.THREE_TWO_FOUR_ONE.

StatsBomb can emit tactical shift events with tactics.formation = 3241, representing a 3-2-4-1 shape. Kloppy already defines FormationType.THREE_TWO_FOUR_ONE, but the StatsBomb FORMATIONS lookup did not include provider code 3241. That means deserializing affected StatsBomb events can raise KeyError: 3241 when building formation change events.

Reproducing Statsbomb Data Point

  • competition_id: 44
  • season_id: 316
  • match_id: 4038279
  • event id: 1c23cbe4-ccc9-4282-8480-e32b63de989c
  • event type: Tactical Shift
  • team: Portland Timbers
  • tactics.formation: 3241

Change

  • Map StatsBomb formation code 3241 to the existing FormationType.THREE_TWO_FOUR_ONE enum value.

@probberechts probberechts merged commit 6c54f8f into PySport:master May 21, 2026
20 checks passed
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.

2 participants