Skip to content

Commit

Permalink
fix: skip in case of empty bdf
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <[email protected]>
  • Loading branch information
Flix6x committed Jan 9, 2025
1 parent 264b167 commit e68cc02
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flexmeasures/data/models/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ def keep_latest_version_in_bdf(bdf: tb.BeliefsDataFrame) -> tb.BeliefsDataFrame:
A new BeliefsDataFrame containing only the latest version of each source
for each event_start, with the original index restored.
"""
if bdf.empty:
return bdf

# Remember the original index, then reset it
index_levels = bdf.index.names
Expand Down

0 comments on commit e68cc02

Please sign in to comment.