Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Update deprecated pandas dtype and distutils #840

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading