Skip to content

Commit

Permalink
Fix pylibcudf imports, branches, and more.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Sep 17, 2024
1 parent 1f40520 commit 250a73a
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ jobs:
cudf-polars-polars-tests:
needs: wheel-build-cudf-polars
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@python-3.12
with:
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
matrix_filter: map(select(.ARCH == "amd64")) | group_by(.CUDA_VER|split(".")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]))
Expand Down
2 changes: 1 addition & 1 deletion ci/test_cudf_polars_polars_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -eou pipefail
# files in cudf_polars/pylibcudf", rather than "are there changes
# between upstream and this branch which touch cudf_polars/pylibcudf"
# TODO: is the target branch exposed anywhere in an environment variable?
if [ -n "$(git diff --name-only origin/branch-24.08...HEAD -- python/cudf_polars/ python/cudf/cudf/_lib/pylibcudf/)" ];
if [ -n "$(git diff --name-only origin/branch-24.10...HEAD -- python/cudf_polars/ python/cudf/cudf/_lib/pylibcudf/)" ];
then
HAS_CHANGES=1
rapids-logger "PR has changes in cudf-polars/pylibcudf, test fails treated as failure"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
strip
=====

.. automodule:: cudf._lib.pylibcudf.strings.strip
.. automodule:: pylibcudf.strings.strip
:members:
2 changes: 1 addition & 1 deletion python/cudf/cudf/_lib/datetime.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from pylibcudf.libcudf.types cimport size_type
from cudf._lib.column cimport Column
from cudf._lib.scalar cimport DeviceScalar

import cudf._lib.pylibcudf as plc
import pylibcudf as plc


@acquire_spill_lock()
Expand Down
4 changes: 3 additions & 1 deletion python/cudf/cudf/_lib/string_casting.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ from pylibcudf.libcudf.types cimport data_type, type_id

from cudf._lib.types cimport underlying_type_t_type_id

import pylibcudf as plc

import cudf
import cudf._lib.pylibcudf as plc

from cudf._lib.types cimport dtype_to_pylibcudf_type


Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/_lib/strings/strip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from pylibcudf.libcudf.strings.strip cimport strip as cpp_strip

from cudf._lib.column cimport Column
from cudf._lib.scalar cimport DeviceScalar
import cudf._lib.pylibcudf as plc
import pylibcudf as plc


@acquire_spill_lock()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from libcpp.string cimport string

from cudf._lib.pylibcudf.column cimport Column
from cudf._lib.pylibcudf.types cimport DataType
from pylibcudf.column cimport Column
from pylibcudf.types cimport DataType


cpdef Column to_timestamps(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
from libcpp.memory cimport unique_ptr
from libcpp.string cimport string
from libcpp.utility cimport move

from cudf._lib.pylibcudf.column cimport Column
from cudf._lib.pylibcudf.libcudf.column.column cimport column
from cudf._lib.pylibcudf.libcudf.strings.convert cimport (
from pylibcudf.column cimport Column
from pylibcudf.libcudf.column.column cimport column
from pylibcudf.libcudf.strings.convert cimport (
convert_datetime as cpp_convert_datetime,
)

from cudf._lib.pylibcudf.types import DataType
from pylibcudf.types import DataType


cpdef Column to_timestamps(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from libcpp.string cimport string

from cudf._lib.pylibcudf.column cimport Column
from cudf._lib.pylibcudf.types cimport DataType
from pylibcudf.column cimport Column
from pylibcudf.types cimport DataType


cpdef Column to_durations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
from libcpp.memory cimport unique_ptr
from libcpp.string cimport string
from libcpp.utility cimport move

from cudf._lib.pylibcudf.column cimport Column
from cudf._lib.pylibcudf.libcudf.column.column cimport column
from cudf._lib.pylibcudf.libcudf.strings.convert cimport (
from pylibcudf.column cimport Column
from pylibcudf.libcudf.column.column cimport column
from pylibcudf.libcudf.strings.convert cimport (
convert_durations as cpp_convert_durations,
)

from cudf._lib.pylibcudf.types import DataType
from pylibcudf.types import DataType


cpdef Column to_durations(
Expand Down
2 changes: 1 addition & 1 deletion python/pylibcudf/pylibcudf/strings/side_type.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from cudf._lib.pylibcudf.libcudf.strings.side_type cimport side_type
from pylibcudf.libcudf.strings.side_type cimport side_type
2 changes: 1 addition & 1 deletion python/pylibcudf/pylibcudf/strings/side_type.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from cudf._lib.pylibcudf.libcudf.strings.side_type import \
from pylibcudf.libcudf.strings.side_type import \
side_type as SideType # no-cython-lint
6 changes: 3 additions & 3 deletions python/pylibcudf/pylibcudf/strings/strip.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from cudf._lib.pylibcudf.column cimport Column
from cudf._lib.pylibcudf.scalar cimport Scalar
from cudf._lib.pylibcudf.strings.side_type cimport side_type
from pylibcudf.column cimport Column
from pylibcudf.scalar cimport Scalar
from pylibcudf.strings.side_type cimport side_type


cpdef Column strip(
Expand Down
15 changes: 7 additions & 8 deletions python/pylibcudf/pylibcudf/strings/strip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
from cython.operator cimport dereference
from libcpp.memory cimport unique_ptr
from libcpp.utility cimport move

from cudf._lib.pylibcudf.column cimport Column
from cudf._lib.pylibcudf.libcudf.column.column cimport column
from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar
from cudf._lib.pylibcudf.libcudf.scalar.scalar_factories cimport (
from pylibcudf.column cimport Column
from pylibcudf.libcudf.column.column cimport column
from pylibcudf.libcudf.scalar.scalar cimport string_scalar
from pylibcudf.libcudf.scalar.scalar_factories cimport (
make_string_scalar as cpp_make_string_scalar,
)
from cudf._lib.pylibcudf.libcudf.strings cimport strip as cpp_strip
from cudf._lib.pylibcudf.scalar cimport Scalar
from cudf._lib.pylibcudf.strings.side_type cimport side_type
from pylibcudf.libcudf.strings cimport strip as cpp_strip
from pylibcudf.scalar cimport Scalar
from pylibcudf.strings.side_type cimport side_type


cpdef Column strip(
Expand Down
3 changes: 1 addition & 2 deletions python/pylibcudf/pylibcudf/tests/test_string_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
from datetime import datetime

import pyarrow as pa
import pylibcudf as plc
import pytest
from utils import assert_column_eq

import cudf._lib.pylibcudf as plc


@pytest.fixture(
scope="module",
Expand Down
3 changes: 1 addition & 2 deletions python/pylibcudf/pylibcudf/tests/test_string_strip.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

import pyarrow as pa
import pylibcudf as plc
import pytest
from utils import assert_column_eq

import cudf._lib.pylibcudf as plc

data_strings = [
"AbC",
"123abc",
Expand Down

0 comments on commit 250a73a

Please sign in to comment.