Skip to content

Commit

Permalink
Fix segfault in groupby-var
Browse files Browse the repository at this point in the history
Previously we'd accidently call compute here when inferring metadata.
The new groupby implementation segfaults when threads are used to
compute the index (apparently), which could happen in some cases.  It's
easier just to let `aca` handle the metadata inference, so we'll remove
it.
  • Loading branch information
jcrist committed Oct 6, 2016
1 parent fc140f3 commit 53400cf
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dask/dataframe/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,10 @@ def mean(self):

@derived_from(pd.core.groupby.GroupBy)
def var(self, ddof=1):
from functools import partial
meta = self.obj._meta
if isinstance(meta, pd.Series):
meta = meta.to_frame()
meta = meta.groupby(self.index).var(ddof=1)
result = aca([self.obj, self.index], chunk=_var_chunk,
aggregate=partial(_var_agg, ddof=ddof), meta=meta,
token=self._token_prefix + 'var')
aggregate=_var_agg,
token=self._token_prefix + 'var',
aggregate_kwargs={'ddof': ddof})

if isinstance(self.obj, Series):
result = result[result.columns[0]]
Expand Down

0 comments on commit 53400cf

Please sign in to comment.