diff --git a/cpp/src/unary/cast_ops.cu b/cpp/src/unary/cast_ops.cu index fcee2b368fcc..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,7 +118,7 @@ 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..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 */ @@ -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)