From d5777e145016a3f3c6cc28c609c78d37983ac79a 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 52419b5d626efb0e460c1ba6be3d905068ab70da 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 34b1762f9d248c505d79f8c78e5f65b40bea1647 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 */