8000 BUG: Groupby selection context not being properly reset by christopherzimmerman · Pull Request #28541 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Groupby selection context not being properly reset #28541 8000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Missed a merge
  • Loading branch information
christopherzimmerman committed Oct 21, 2019
commit f24c05ca22f7f36f296e94ebf1d1d3648f7587e5
33 changes: 11 additions & 22 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,32 +1335,21 @@ def f(self, **kwargs):
kwargs["min_count"] = min_count

with _group_selection_context(self):

<<<<<<< HEAD
# try a cython aggregation if we can
try:
return self._cython_agg_general(alias, alt=npfunc, **kwargs)
except AssertionError as e:
raise SpecificationError(str(e))
except Exception:
pass
=======
# try a cython aggregation if we can
try:
return self._cython_agg_general(alias, alt=npfunc, **kwargs)
except DataError:
pass
except NotImplementedError as err:
if "function is not implemented for this dtype" in str(err):
# raised in _get_cython_function, in some cases can
# be trimmed by implementing cython funcs for more dtypes
except DataError:
pass
elif "decimal does not support skipna=True" in str(err):
# FIXME: kludge for test_decimal:test_in_numeric_groupby
pass
else:
raise
>>>>>>> upstream/master
except NotImplementedError as err:
if "function is not implemented for this dtype" in str(err):
# raised in _get_cython_function, in some cases can
# be trimmed by implementing cython funcs for more dtypes
pass
elif "decimal does not support skipna=True" in str(err):
# FIXME: kludge for test_decimal:test_in_numeric_groupby
pass
else:
raise

# apply a non-cython aggregation
result = self.aggregate(lambda x: npfunc(x, axis=self.axis))
Expand Down
0