From c6c28a1221e18afd2a08550367ad79dfa92713f7 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Wed, 18 Mar 2026 18:53:36 +0000 Subject: [PATCH] fix orc failures --- .../statistics_type_identification.cuh | 4 +++- .../cudf/cudf/tests/input_output/test_orc.py | 20 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/cpp/src/io/statistics/statistics_type_identification.cuh b/cpp/src/io/statistics/statistics_type_identification.cuh index 825e50860438..ed7812419afe 100644 --- a/cpp/src/io/statistics/statistics_type_identification.cuh +++ b/cpp/src/io/statistics/statistics_type_identification.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -37,9 +37,11 @@ struct conversion_map; template struct conversion_map { using types = std::tuple, + std::pair, std::pair, std::pair, std::pair, + std::pair, std::pair, std::pair>; }; diff --git a/python/cudf/cudf/tests/input_output/test_orc.py b/python/cudf/cudf/tests/input_output/test_orc.py index 0e6d224cb7d9..9a3789fa405c 100644 --- a/python/cudf/cudf/tests/input_output/test_orc.py +++ b/python/cudf/cudf/tests/input_output/test_orc.py @@ -607,7 +607,11 @@ def normalized_equals(value1, value2): if isinstance(value1, float) or isinstance(value2, float): return np.isclose(value1, value2) - return value1 == value2 + try: + assert_eq(value1, value2) + return True + except AssertionError: + return False @pytest.mark.parametrize("stats_freq", ["STRIPE", "ROWGROUP"]) @@ -1473,8 +1477,10 @@ def test_orc_writer_lists_empty_rg(): df = cudf.read_orc(buffer) assert_eq(df, cudf_in) - pdf_out = pd.read_orc(buffer) - assert_eq(pdf_in, pdf_out) + # Compare via pyarrow since pd.read_orc converts nullable integer + # lists to float arrays ([None] -> [nan]), losing the original types. + pa_out = orc.ORCFile(buffer).read() + assert pa_out.equals(cudf_in.to_arrow()) def test_statistics_sum_overflow(): @@ -1647,7 +1653,13 @@ def run_orc_columns_and_index_param(index_obj, index, columns): expected = pd.read_orc(buffer, columns=columns) got = cudf.read_orc(buffer, columns=columns) - assert_eq(expected, got, check_index_type=True) + # When columns is an empty list, pandas uses dtype='object' for + # the empty column Index while cudf uses dtype='str'. Avoid + # checking the column index type in that case. + check_col_type = columns is None or len(columns) > 0 + assert_eq( + expected, got, check_index_type=True, check_column_type=check_col_type + ) @pytest.mark.parametrize("index_obj", [None, [10, 11, 12], ["x", "y", "z"]])