diff --git a/db_dtypes/core.py b/db_dtypes/core.py index e9ab4ad..567b931 100644 --- a/db_dtypes/core.py +++ b/db_dtypes/core.py @@ -90,10 +90,12 @@ def astype(self, dtype, copy=True): def _cmp_method(self, other, op): """Compare array values, for use in OpsMixin.""" - if is_scalar(other) and (pandas.isna(other) or type(other) == self.dtype.type): + if is_scalar(other) and ( + pandas.isna(other) or isinstance(other, self.dtype.type) + ): other = type(self)([other]) - if type(other) != type(self): + if type(other) is not type(self): return NotImplemented oshape = getattr(other, "shape", None)