Skip to content

Commit

Permalink
Protect dtype casting only when column is in column_name_to_column_dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Jan 10, 2025
1 parent 8353160 commit 33feca3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def _compute_metrics(self, sorting_analyzer, unit_ids=None, verbose=False, metri
# we do this because the convert_dtypes infers the wrong types sometimes.
# the actual types for columns can be found in column_name_to_column_dtype dictionary.
for column in metrics.columns:
metrics[column] = metrics[column].astype(column_name_to_column_dtype[column])
if column in column_name_to_column_dtype:
metrics[column] = metrics[column].astype(column_name_to_column_dtype[column])

return metrics

Expand Down

0 comments on commit 33feca3

Please sign in to comment.