diff --git a/python/xorbits/_mars/tensor/statistics/bincount.py b/python/xorbits/_mars/tensor/statistics/bincount.py index bb25fe03e..fcec8603a 100644 --- a/python/xorbits/_mars/tensor/statistics/bincount.py +++ b/python/xorbits/_mars/tensor/statistics/bincount.py @@ -286,8 +286,10 @@ def bincount(x, weights=None, minlength=0, chunk_size_limit=None): x = astensor(x) weights = astensor(weights) if weights is not None else None - if not np.issubdtype(x.dtype, np.int_): - raise TypeError(f"Cannot cast array data from {x.dtype} to {np.dtype(np.int_)}") + if not np.issubdtype(x.dtype, np.int64): + raise TypeError( + f"Cannot cast array data from {x.dtype} to {np.dtype(np.int64)}" + ) if x.ndim != 1: raise ValueError("'x' must be 1 dimension") if minlength < 0: diff --git a/python/xorbits/_mars/utils.py b/python/xorbits/_mars/utils.py index 7c54ddd3d..91f00ede4 100644 --- a/python/xorbits/_mars/utils.py +++ b/python/xorbits/_mars/utils.py @@ -489,13 +489,15 @@ def calc_data_size(dt: Any, shape: Tuple[int] = None) -> int: return 0 if isinstance(dt, tuple): - return sum(calc_data_size(c) for c in dt) + # int() for windows CI, otherwise may return numpy.int32 by `sum` + return int(sum(calc_data_size(c) for c in dt)) shape = getattr(dt, "shape", None) or shape if isinstance(dt, (pd.DataFrame, pd.Series)): return estimate_pandas_size(dt) if hasattr(dt, "estimate_size"): - return dt.estimate_size() + # int() for windows CI, otherwise may return numpy.int32 + return int(dt.estimate_size()) if dt.estimate_size() is not None else None if hasattr(dt, "nbytes"): return max(sys.getsizeof(dt), dt.nbytes) if hasattr(dt, "shape") and len(dt.shape) == 0: