Skip to content

Commit

Permalink
ENH: Update deprecated pandas dtype and distutils (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
hainaweiben authored Jan 9, 2025
1 parent 55aafbb commit 081d5f9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 679,7 @@ def test_loc_use_iloc():
assert isinstance(df2.loc["a3":].op, DataFrameLocGetItem)

raw2 = raw.copy()
raw2.index = [f"a{i}" for i in range(3)]
raw2.index = [f"idx{i}" for i in range(3)]
df2 = md.DataFrame(raw2, chunk_size=2)

assert isinstance(df2.loc[:3].op, DataFrameLocGetItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 169,7 @@ def test_sort_values_execution(setup, distinct_opt):
# test None (issue #1885)
df = pd.DataFrame(np.random.rand(1000, 10))

df[0] = df[0].astype("object")
df[0][df[0] < 0.5] = "A"
df[0][df[0] != "A"] = None

Expand Down Expand Up @@ -262,6 263,7 @@ def test_sort_values_execution(setup, distinct_opt):
# test series with None
series = pd.Series(np.arange(1000))

series = series.astype("object")
series[series < 500] = "A"
series[series != "A"] = None

Expand Down
7 changes: 3 additions & 4 deletions python/xorbits/deploy/kubernetes/tests/test_kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 27,6 @@
import tempfile
import uuid
from contextlib import contextmanager
from distutils.spawn import find_executable

import numpy as np

Expand All @@ -45,8 44,8 @@
k8s = lazy_import("kubernetes")

kube_available = (
find_executable("kubectl") is not None
and find_executable("docker") is not None
shutil.which("kubectl") is not None
and shutil.which("docker") is not None
and k8s is not None
)

Expand All @@ -55,7 54,7 @@ def _collect_coverage():
dist_coverage_path = os.path.join(XORBITS_ROOT, ".dist-coverage")
if os.path.exists(dist_coverage_path):
# change ownership of coverage files
if find_executable("sudo"):
if shutil.which("sudo"):
proc = subprocess.Popen(
[
"sudo",
Expand Down
4 changes: 2 additions & 2 deletions python/xorbits/deploy/slurm/tests/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from distutils.spawn import find_executable
import shutil

import pytest

from .... import init
from .... import pandas as pd
from .. import SLURMCluster

slurm_available = find_executable("sbatch") is not None
slurm_available = shutil.which("sbatch") is not None


def test_header_core_process_memory():
Expand Down

0 comments on commit 081d5f9

Please sign in to comment.