From 1006f910d3fbaa5d80039d94545a87a01626c0b8 Mon Sep 17 00:00:00 2001 From: John Zedlewski Date: Mon, 10 Aug 2026 20:54:34 +0000 Subject: [PATCH 1/3] Make is_supported_cast fail for variable-width inputs --- cpp/src/unary/cast_ops.cu | 3 ++- cpp/tests/unary/cast_tests.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/src/unary/cast_ops.cu b/cpp/src/unary/cast_ops.cu index fcee2b368fcc..60f50eb8aa88 100644 --- a/cpp/src/unary/cast_ops.cu +++ b/cpp/src/unary/cast_ops.cu @@ -118,7 +118,8 @@ struct fixed_point_unary_cast { template constexpr inline auto is_supported_non_fixed_point_cast() { - return cudf::is_fixed_width() && + return cudf::is_fixed_width() && + cudf::is_fixed_width() && // Disallow fixed_point here (requires different specialization) !(cudf::is_fixed_point() || cudf::is_fixed_point()) && // Disallow conversions between timestamps and numeric diff --git a/cpp/tests/unary/cast_tests.cpp b/cpp/tests/unary/cast_tests.cpp index 5fcec956a8d9..fad01dee272d 100644 --- a/cpp/tests/unary/cast_tests.cpp +++ b/cpp/tests/unary/cast_tests.cpp @@ -201,6 +201,12 @@ inline auto make_data_type() return cudf::data_type{cudf::type_to_id()}; } +TEST(IsSupportedCast, StringToInt32IsUnsupported) +{ + EXPECT_FALSE(cudf::is_supported_cast(cudf::data_type{cudf::type_id::STRING}, + cudf::data_type{cudf::type_id::INT32})); +} + struct CastTimestampsSimple : public cudf::test::BaseFixture {}; TEST_F(CastTimestampsSimple, IsIdempotent) From 715e98ca39036f8c0304ffbd9aebff776e08e3eb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 21:46:50 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto code formatting --- cpp/src/unary/cast_ops.cu | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/src/unary/cast_ops.cu b/cpp/src/unary/cast_ops.cu index 60f50eb8aa88..49fbbf76e663 100644 --- a/cpp/src/unary/cast_ops.cu +++ b/cpp/src/unary/cast_ops.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -118,8 +118,7 @@ struct fixed_point_unary_cast { template constexpr inline auto is_supported_non_fixed_point_cast() { - return cudf::is_fixed_width() && - cudf::is_fixed_width() && + return cudf::is_fixed_width() && cudf::is_fixed_width() && // Disallow fixed_point here (requires different specialization) !(cudf::is_fixed_point() || cudf::is_fixed_point()) && // Disallow conversions between timestamps and numeric From e8ca74d6bc39f033b1fae3fc686bcedccd867e1c Mon Sep 17 00:00:00 2001 From: John Zedlewski Date: Mon, 10 Aug 2026 22:12:26 +0000 Subject: [PATCH 3/3] Fix cast tests header comment --- cpp/tests/unary/cast_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/tests/unary/cast_tests.cpp b/cpp/tests/unary/cast_tests.cpp index fad01dee272d..1fa8a825670d 100644 --- a/cpp/tests/unary/cast_tests.cpp +++ b/cpp/tests/unary/cast_tests.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */