Skip to content

Commit

Permalink
Revert changes caused by Pandas as it was fixed in pandas-dev/pandas#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aresnow1 committed Dec 19, 2022
1 parent 5b3f738 commit b66358d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion mars/dataframe/reduction/all.py
Expand Up @@ -71,7 +71,7 @@ def tile(cls, op):

def __call__(self, df):
if self.axis is None and isinstance(df, DATAFRAME_TYPE):
return self.new_scalar([df], np.bool)
return self.new_scalar([df], np.dtype("bool"))
else:
return super().__call__(df)

Expand Down
2 changes: 1 addition & 1 deletion mars/dataframe/reduction/any.py
Expand Up @@ -71,7 +71,7 @@ def tile(cls, op):

def __call__(self, df):
if self.axis is None and isinstance(df, DATAFRAME_TYPE):
return self.new_scalar([df], np.bool)
return self.new_scalar([df], np.dtype("bool"))
else:
return super().__call__(df)

Expand Down
9 changes: 0 additions & 9 deletions mars/dataframe/reduction/tests/test_reduction_execution.py
Expand Up @@ -42,18 +42,9 @@
def check_ref_counts():
yield

import functools
import gc

# In https://github.com/pandas-dev/pandas/pull/48023, pandas cache current frame in this PR
# which leads to failure of decref mechanism.
gc.collect()
wrappers = [
a for a in gc.get_objects() if isinstance(a, functools._lru_cache_wrapper)
]

for wrapper in wrappers:
wrapper.cache_clear()

sess = get_default_session()
assert len(sess._get_ref_counts()) == 0
Expand Down
6 changes: 2 additions & 4 deletions mars/tensor/indexing/fill_diagonal.py
Expand Up @@ -184,10 +184,8 @@ def _tile_nd(cls, op, val):
# if more than 3d, we will rechunk the tensor into square chunk
# on the diagonal direction
in_tensor = op.input
nsplits = np.array(in_tensor.nsplits)
if not np.issubdtype(nsplits.dtype, np.integer) or not np.all(
np.diff(nsplits, axis=1) == 0
):
nsplits = [tuple(np.array(split)) for split in in_tensor.nsplits]
if set(nsplits) != 1:
# need rechunk
nsplit = decide_unify_split(*in_tensor.nsplits)
in_tensor = yield from recursive_tile(
Expand Down

0 comments on commit b66358d

Please sign in to comment.