Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions flexmeasures/data/models/reporting/pandas_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,14 @@ def _any_empty(objs):
if (_any_empty(args) or _any_empty(kwargs.values())) and skip_if_empty:
self.data[df_output] = self.data[df_input]
else:
self.data[df_output] = getattr(self.data[df_input], method)(
*args, **kwargs
)
try:
self.data[df_output] = getattr(self.data[df_input], method)(
*args, **kwargs
)
except TypeError as exc:
if "unhashable type" in str(exc) and method == "sum":
raise TypeError(
"Consider using 'add' instead of 'sum' as the transformation method."
) from exc

previous_df = df_output