Skip to content

Commit

Permalink
Updated pandas-dev#58748 and Added Test
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddheshBangar committed May 22, 2024
1 parent 6b51796 commit 91d4d00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pandas/core/computation/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ def _disallow_scalar_only_bool_ops(self) -> None:


def isnumeric(dtype) -> bool:
return getattr(dtype, '_is_numeric', False) or issubclass(np.dtype(dtype).type, np.number)
return getattr(dtype, "_is_numeric", False) or issubclass(
np.dtype(dtype).type, np.number
)


class Div(BinOp):
Expand Down
7 changes: 7 additions & 0 deletions pandas/tests/extension/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ def cmp(a, b):
return cmp


@pytest.fixture
def isnumeric(dtype):
return getattr(dtype, "is_numeric", False) or issubclass(
np.dtype(dtype).type, np.number
)


# ----------------------------------------------------------------------------
class TestDatetimeArray(base.ExtensionTests):
def _get_expected_exception(self, op_name, obj, other):
Expand Down

0 comments on commit 91d4d00

Please sign in to comment.