diff --git a/pint_pandas/pint_array.py b/pint_pandas/pint_array.py index 01579c7..3eefc23 100644 --- a/pint_pandas/pint_array.py +++ b/pint_pandas/pint_array.py @@ -338,7 +338,7 @@ def __neg__(self): return -1 * self def __abs__(self): - return self._Q(np.abs(self._data), self._dtype.units) + return type(self)(self._Q(np.abs(self._data), self._dtype.units)) @property def dtype(self): diff --git a/pint_pandas/testsuite/test_pandas_extensiontests.py b/pint_pandas/testsuite/test_pandas_extensiontests.py index 11d9281..535a226 100644 --- a/pint_pandas/testsuite/test_pandas_extensiontests.py +++ b/pint_pandas/testsuite/test_pandas_extensiontests.py @@ -574,11 +574,6 @@ def test_unstack(self, data, index, obj): def test_invert(self, data): base.BaseUnaryOpsTests.test_invert(self, data) - @pytest.mark.xfail(run=True, reason="np.positive requires pint 0.21") - @pytest.mark.parametrize("ufunc", [np.positive, np.negative, np.abs]) - def test_unary_ufunc_dunder_equivalence(self, data, ufunc): - base.BaseUnaryOpsTests.test_unary_ufunc_dunder_equivalence(self, data, ufunc) - # Accumulate def _supports_accumulation(self, ser: pd.Series, op_name: str) -> bool: return True