[PR #309] [MERGED] Handle canceled / forfeited games #451

Closed
opened 2026-03-02 15:58:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/probberechts/soccerdata/pull/309
Author: @lorenzodb1
Created: 7/27/2023
Status: Merged
Merged: 7/27/2023
Merged by: @probberechts

Base: masterHead: lorenzodb1_fix_tottenham_concat_bug


📝 Commits (8)

  • cf1e503 Removed unused import
  • d866de3 Rebased to current master
  • 6992ee9 Added test for the case where _concat is used with forfeited matches
  • 38223e6 Changed logic in _concat to better deal with dfs with columns not matching
  • 4837bd1 Test for forfeited games should make sure order doesn't matter
  • c010523 Changes from pre-commit that were not applied before
  • fde36e6 Changed _concat to return the same columns when there's a forfeited match regardless of the order of matches
  • 7aa1446 Re-added missing if statement

📊 Changes

2 files changed (+26 additions, -24 deletions)

View changed files

📝 soccerdata/fbref.py (+18 -11)
📝 tests/test_FBref.py (+8 -13)

📄 Description

_concat would throw an error when analysing Tottenham-Rennes, as the game was forfeited and, therefore, there is no match data available for it. The dataframe resulting from this page had fewer columns than the ones for other games in the competition, thus throwing an error.

This is a new attempt to solve #304.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/probberechts/soccerdata/pull/309 **Author:** [@lorenzodb1](https://github.com/lorenzodb1) **Created:** 7/27/2023 **Status:** ✅ Merged **Merged:** 7/27/2023 **Merged by:** [@probberechts](https://github.com/probberechts) **Base:** `master` ← **Head:** `lorenzodb1_fix_tottenham_concat_bug` --- ### 📝 Commits (8) - [`cf1e503`](https://github.com/probberechts/soccerdata/commit/cf1e50337bddae8d819099a7660ed6a1756b2c59) Removed unused import - [`d866de3`](https://github.com/probberechts/soccerdata/commit/d866de3d5dc8b4a41958e9cb65c1591ea0ce554a) Rebased to current master - [`6992ee9`](https://github.com/probberechts/soccerdata/commit/6992ee92d45b010ba875362f2db1ed82cd74cc21) Added test for the case where _concat is used with forfeited matches - [`38223e6`](https://github.com/probberechts/soccerdata/commit/38223e61cb848d102957f083b8e5cdcb14878eee) Changed logic in _concat to better deal with dfs with columns not matching - [`4837bd1`](https://github.com/probberechts/soccerdata/commit/4837bd19e6d522d37cf6ff5bca793b0e65cfa473) Test for forfeited games should make sure order doesn't matter - [`c010523`](https://github.com/probberechts/soccerdata/commit/c0105236833ec524a26f3a86a64150eeee7e4f85) Changes from pre-commit that were not applied before - [`fde36e6`](https://github.com/probberechts/soccerdata/commit/fde36e636b7db360e32766493185ab3266f06bce) Changed _concat to return the same columns when there's a forfeited match regardless of the order of matches - [`7aa1446`](https://github.com/probberechts/soccerdata/commit/7aa1446a2a4e0c441cce5cfe0ca5316963f14180) Re-added missing if statement ### 📊 Changes **2 files changed** (+26 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `soccerdata/fbref.py` (+18 -11) 📝 `tests/test_FBref.py` (+8 -13) </details> ### 📄 Description _concat would throw an error when analysing [Tottenham-Rennes](https://fbref.com/en/matches/d69a0a11/Tottenham-Hotspur-Rennes-December-9-2021-Europa-Conference-League), as the game was forfeited and, therefore, there is no match data available for it. The dataframe resulting from this page had fewer columns than the ones for other games in the competition, thus throwing an error. This is a new attempt to solve #304. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 15:58:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#451
No description provided.