Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/branch-23.10-xdf' into bug/to_…
Browse files Browse the repository at this point in the history
…datetime/format_range
  • Loading branch information
mroeschke committed Oct 3, 2023
2 parents e2a24fb + 13dc80a commit 75f7027
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ci/build_wheel_cudf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export SKBUILD_CONFIGURE_OPTIONS="-DCUDF_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF"
CUDF_BUILD_BRANCH=${1:-""}
WHEEL_NAME_PREFIX="cudf_"
if [[ "${CUDF_BUILD_BRANCH}" == "main" ]]; then
git checkout branch-23.10-xdf
MAIN_COMMIT=$(git merge-base HEAD origin/branch-23.10-xdf)
git checkout $MAIN_COMMIT
WHEEL_NAME_PREFIX="cudf_${CUDF_BUILD_BRANCH}_"
fi

Expand Down
3 changes: 2 additions & 1 deletion ci/xdf_scripts/pandas-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ rapids-logger "PR number: $RAPIDS_REF_NAME"

WHEEL_NAME_PREFIX="cudf_"
if [[ "${PANDAS_TESTS_BRANCH}" == "main" ]]; then
git checkout branch-23.10-xdf
MAIN_COMMIT=$(git merge-base HEAD origin/branch-23.10-xdf)
git checkout $MAIN_COMMIT
WHEEL_NAME_PREFIX="cudf_${PANDAS_TESTS_BRANCH}_"
fi

Expand Down
4 changes: 4 additions & 0 deletions python/cudf/cudf/core/multiindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,10 @@ def values(self):
>>> type(midx.values)
<class 'cupy...ndarray'>
"""
if cudf.get_option("mode.pandas_compatible"):
raise NotImplementedError(
"Unable to create a cupy array with tuples."
)
return self.to_frame(index=False).values

@classmethod
Expand Down
5 changes: 5 additions & 0 deletions python/cudf/cudf/pandas/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

from .magics import load_ipython_extension

__all__ = ["load_ipython_extension"]
6 changes: 6 additions & 0 deletions python/cudf/cudf/pandas/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

from xdf.autoload.__main__ import main

if __name__ == "__main__":
main()
7 changes: 7 additions & 0 deletions python/cudf/cudf/pandas/magics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.


def load_ipython_extension(ip):
import xdf.autoload

xdf.autoload.install()
7 changes: 7 additions & 0 deletions python/cudf/cudf/tests/test_multiindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,3 +2009,10 @@ def test_multiindex_to_frame_allow_duplicates(
)

assert_eq(expected, actual)


def test_multiindex_values_pandas_compatible():
midx = cudf.MultiIndex.from_tuples([(10, 12), (8, 9), (3, 4)])
with cudf.option_context("mode.pandas_compatible", True):
with pytest.raises(NotImplementedError):
midx.values

0 comments on commit 75f7027

Please sign in to comment.