Skip to content

Commit

Permalink
Fix Ensemble.batch(on=None/str)
Browse files Browse the repository at this point in the history
Closes #202
  • Loading branch information
hombit committed Aug 24, 2023
1 parent 0a29578 commit e2b5fae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tape/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import warnings
import json
import requests
from collections.abc import Collection

import dask.dataframe as dd
import numpy as np
Expand Down Expand Up @@ -728,6 +729,8 @@ def batch(self, func, *args, meta=None, use_map=True, compute=True, on=None, **k

if on is None:
on = self._id_col # Default grouping is by id_col
if not isinstance(on, Collection):
on = [on] # Convert to list if only one column is passed

# Handle object columns to group on
source_cols = list(self._source.columns)
Expand Down

0 comments on commit e2b5fae

Please sign in to comment.