From 6b6947a3212c20811d8225172307577da73286c3 Mon Sep 17 00:00:00 2001 From: Matt711 Date: Mon, 24 Feb 2025 10:06:23 -0500 Subject: [PATCH 1/6] Bump polars version to <1.24 --- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- conda/environments/all_cuda-128_arch-x86_64.yaml | 2 +- conda/recipes/cudf-polars/meta.yaml | 2 +- dependencies.yaml | 2 +- python/cudf_polars/pyproject.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index cc674732ba4..e7e0cb17606 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -66,7 +66,7 @@ dependencies: - pandas - pandas>=2.0,<2.2.4dev0 - pandoc -- polars>=1.20,<1.23 +- polars>=1.20,<1.24 - pre-commit - ptxcompiler - pyarrow>=14.0.0,<20.0.0a0 diff --git a/conda/environments/all_cuda-128_arch-x86_64.yaml b/conda/environments/all_cuda-128_arch-x86_64.yaml index 7593a72cc68..c95b8b10299 100644 --- a/conda/environments/all_cuda-128_arch-x86_64.yaml +++ b/conda/environments/all_cuda-128_arch-x86_64.yaml @@ -64,7 +64,7 @@ dependencies: - pandas - pandas>=2.0,<2.2.4dev0 - pandoc -- polars>=1.20,<1.23 +- polars>=1.20,<1.24 - pre-commit - pyarrow>=14.0.0,<20.0.0a0 - pydata-sphinx-theme>=0.15.4 diff --git a/conda/recipes/cudf-polars/meta.yaml b/conda/recipes/cudf-polars/meta.yaml index 1d36ab2a3e4..64a147d3c63 100644 --- a/conda/recipes/cudf-polars/meta.yaml +++ b/conda/recipes/cudf-polars/meta.yaml @@ -43,7 +43,7 @@ requirements: run: - python - pylibcudf ={{ version }} - - polars >=1.20,<1.23 + - polars >=1.20,<1.24 - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} test: diff --git a/dependencies.yaml b/dependencies.yaml index e7840d56880..c5216a9cb1f 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -813,7 +813,7 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - polars>=1.20,<1.23 + - polars>=1.20,<1.24 run_cudf_polars_experimental: common: - output_types: [conda, requirements, pyproject] diff --git a/python/cudf_polars/pyproject.toml b/python/cudf_polars/pyproject.toml index 872c08a66f9..f8c0a7d9d4b 100644 --- a/python/cudf_polars/pyproject.toml +++ b/python/cudf_polars/pyproject.toml @@ -19,7 +19,7 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.10" dependencies = [ - "polars>=1.20,<1.23", + "polars>=1.20,<1.24", "pylibcudf==25.4.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ From 426c83e4a97d4240e9fb3704a49df4e9c73fe018 Mon Sep 17 00:00:00 2001 From: Matt711 Date: Mon, 24 Feb 2025 10:18:24 -0500 Subject: [PATCH 2/6] skip test --- python/cudf_polars/cudf_polars/testing/plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/cudf_polars/cudf_polars/testing/plugin.py b/python/cudf_polars/cudf_polars/testing/plugin.py index a7b10a6e8fa..fedc6b073c0 100644 --- a/python/cudf_polars/cudf_polars/testing/plugin.py +++ b/python/cudf_polars/cudf_polars/testing/plugin.py @@ -215,6 +215,7 @@ def pytest_configure(config: pytest.Config) -> None: # The test may segfault with the legacy streaming engine. We should # remove this skip when all polars tests use the new streaming engine. "tests/unit/streaming/test_streaming_group_by.py::test_streaming_group_by_literal[1]": "May segfault w/the legacy streaming engine", + "tests/unit/streaming/test_streaming_io.py::test_empty_sink_parquet_join_14863": "May segfault w/the legacy streaming engine", # Fails in CI, but passes locally "tests/unit/streaming/test_streaming.py::test_streaming_streamable_functions": "RuntimeError: polars_python::sql::PySQLContext is unsendable, but is being dropped on another thread", # TODO: Remove once when we support polars 1.23 From ca75c4c32791c1a6dee926553e0f3e76cf089305 Mon Sep 17 00:00:00 2001 From: Matt711 Date: Mon, 24 Feb 2025 10:32:27 -0500 Subject: [PATCH 3/6] remove xfail --- python/cudf_polars/cudf_polars/testing/plugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/cudf_polars/cudf_polars/testing/plugin.py b/python/cudf_polars/cudf_polars/testing/plugin.py index fedc6b073c0..fdfb173cd9f 100644 --- a/python/cudf_polars/cudf_polars/testing/plugin.py +++ b/python/cudf_polars/cudf_polars/testing/plugin.py @@ -197,7 +197,6 @@ def pytest_configure(config: pytest.Config) -> None: "tests/unit/io/test_multiscan.py::test_include_file_paths[scan_csv-write_csv]": "Need to expose include_file_paths xref: cudf#18012", "tests/unit/streaming/test_streaming_io.py::test_parquet_eq_statistics[False]": "Debug output on stderr doesn't match", # Maybe flaky, order-dependent? - "tests/unit/test_projections.py::test_schema_full_outer_join_projection_pd_13287": "Order-specific result check, query is correct but in different order", "tests/unit/test_queries.py::test_group_by_agg_equals_zero_3535": "libcudf sums all nulls to null, not zero", } From 7b75d0b688d310f2becd0bc273e05742b362aeed Mon Sep 17 00:00:00 2001 From: Matt711 Date: Mon, 24 Feb 2025 11:59:48 -0500 Subject: [PATCH 4/6] fallback to polars on cast from empty to string --- .../cudf_polars/cudf_polars/testing/plugin.py | 1 - python/cudf_polars/cudf_polars/utils/dtypes.py | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/python/cudf_polars/cudf_polars/testing/plugin.py b/python/cudf_polars/cudf_polars/testing/plugin.py index fdfb173cd9f..9b798688992 100644 --- a/python/cudf_polars/cudf_polars/testing/plugin.py +++ b/python/cudf_polars/cudf_polars/testing/plugin.py @@ -214,7 +214,6 @@ def pytest_configure(config: pytest.Config) -> None: # The test may segfault with the legacy streaming engine. We should # remove this skip when all polars tests use the new streaming engine. "tests/unit/streaming/test_streaming_group_by.py::test_streaming_group_by_literal[1]": "May segfault w/the legacy streaming engine", - "tests/unit/streaming/test_streaming_io.py::test_empty_sink_parquet_join_14863": "May segfault w/the legacy streaming engine", # Fails in CI, but passes locally "tests/unit/streaming/test_streaming.py::test_streaming_streamable_functions": "RuntimeError: polars_python::sql::PySQLContext is unsendable, but is being dropped on another thread", # TODO: Remove once when we support polars 1.23 diff --git a/python/cudf_polars/cudf_polars/utils/dtypes.py b/python/cudf_polars/cudf_polars/utils/dtypes.py index 6bb5d78c488..85a4f007cf0 100644 --- a/python/cudf_polars/cudf_polars/utils/dtypes.py +++ b/python/cudf_polars/cudf_polars/utils/dtypes.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. # SPDX-License-Identifier: Apache-2.0 """Datatype utilities.""" @@ -71,7 +71,9 @@ def can_cast(from_: plc.DataType, to: plc.DataType) -> bool: ------- True if casting is supported, False otherwise """ - has_empty = from_.id() == plc.TypeId.EMPTY or to.id() == plc.TypeId.EMPTY + to_is_empty = to.id() == plc.TypeId.EMPTY + from_is_empty = from_.id() == plc.TypeId.EMPTY + has_empty = to_is_empty or from_is_empty return ( ( from_ == to @@ -84,8 +86,16 @@ def can_cast(from_: plc.DataType, to: plc.DataType) -> bool: ) ) ) - or (from_.id() == plc.TypeId.STRING and is_numeric_not_bool(to)) - or (to.id() == plc.TypeId.STRING and is_numeric_not_bool(from_)) + or ( + from_.id() == plc.TypeId.STRING + and not to_is_empty + and is_numeric_not_bool(to) + ) + or ( + to.id() == plc.TypeId.STRING + and not from_is_empty + and is_numeric_not_bool(from_) + ) ) From e1982320a2fedb2defc2b07b8d5020774b872d78 Mon Sep 17 00:00:00 2001 From: Matt711 Date: Tue, 25 Feb 2025 15:43:31 -0500 Subject: [PATCH 5/6] remove polars-cloud dependency --- ci/test_cudf_polars_polars_tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/test_cudf_polars_polars_tests.sh b/ci/test_cudf_polars_polars_tests.sh index 3466edacfc5..990cbfe7ff8 100755 --- a/ci/test_cudf_polars_polars_tests.sh +++ b/ci/test_cudf_polars_polars_tests.sh @@ -26,6 +26,8 @@ git clone https://github.com/pola-rs/polars.git --branch "${TAG}" --depth 1 # Install requirements for running polars tests rapids-logger "Install polars test requirements" +# TODO: Remove sed command when polars-colud supports 1.23 +sed -i '/^polars-cloud$/d' polars/py-polars/requirements-dev.txt rapids-pip-retry install -r polars/py-polars/requirements-dev.txt -r polars/py-polars/requirements-ci.txt # shellcheck disable=SC2317 From a005c80dd82ef62bc69bcad916f2d68af6fa0025 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 26 Feb 2025 23:13:02 -0600 Subject: [PATCH 6/6] Fix typo --- ci/test_cudf_polars_polars_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test_cudf_polars_polars_tests.sh b/ci/test_cudf_polars_polars_tests.sh index 990cbfe7ff8..1df7bb61834 100755 --- a/ci/test_cudf_polars_polars_tests.sh +++ b/ci/test_cudf_polars_polars_tests.sh @@ -26,7 +26,7 @@ git clone https://github.com/pola-rs/polars.git --branch "${TAG}" --depth 1 # Install requirements for running polars tests rapids-logger "Install polars test requirements" -# TODO: Remove sed command when polars-colud supports 1.23 +# TODO: Remove sed command when polars-cloud supports 1.23 sed -i '/^polars-cloud$/d' polars/py-polars/requirements-dev.txt rapids-pip-retry install -r polars/py-polars/requirements-dev.txt -r polars/py-polars/requirements-ci.txt