diff --git a/cpp/benchmarks/io/csv/csv_reader_options.cpp b/cpp/benchmarks/io/csv/csv_reader_options.cpp index 9fa5b479932b..19bddc403330 100644 --- a/cpp/benchmarks/io/csv/csv_reader_options.cpp +++ b/cpp/benchmarks/io/csv/csv_reader_options.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -51,7 +51,6 @@ void BM_csv_read_varying_options( .compression(cudf::io::compression_type::NONE) .use_cols_indexes(cols_to_read) .thousands('\'') - .windowslinetermination(true) .comment('#') .prefix("BM_"); diff --git a/cpp/include/cudf/io/csv.hpp b/cpp/include/cudf/io/csv.hpp index 7c3ab615786a..86504c1c759b 100644 --- a/cpp/include/cudf/io/csv.hpp +++ b/cpp/include/cudf/io/csv.hpp @@ -325,9 +325,16 @@ class csv_reader_options { /** * @brief Whether to treat `\r\n` as line terminator. * + * @deprecated Deprecated in 26.10 and will be removed in 26.12+. CRLF input is supported using + * the default `\n` line terminator. + * * @return `true` if `\r\n` is treated as line terminator */ - [[nodiscard]] bool is_enabled_windowslinetermination() const { return _windowslinetermination; } + [[nodiscard]] [[deprecated("CRLF input is supported using the default `\\n` line terminator.")]] + bool is_enabled_windowslinetermination() const + { + return _windowslinetermination; + } /** * @brief Whether to treat whitespace as field delimiter. @@ -657,9 +664,16 @@ class csv_reader_options { /** * @brief Sets whether to treat `\r\n` as line terminator. * + * @deprecated Deprecated in 26.10 and will be removed in 26.12+. CRLF input is supported using + * the default `\n` line terminator. + * * @param val Boolean value to enable/disable */ - void enable_windowslinetermination(bool val) { _windowslinetermination = val; } + [[deprecated("CRLF input is supported using the default `\\n` line terminator.")]] + void enable_windowslinetermination(bool val) + { + _windowslinetermination = val; + } /** * @brief Sets whether to treat whitespace as field delimiter. @@ -1065,12 +1079,16 @@ class csv_reader_options_builder { /** * @brief Sets whether to treat `\r\n` as line terminator. * + * @deprecated Deprecated in 26.10 and will be removed in 26.12+. CRLF input is supported using + * the default `\n` line terminator. + * * @param val Boolean value to enable/disable * @return this for chaining */ + [[deprecated("CRLF input is supported using the default `\\n` line terminator.")]] csv_reader_options_builder& windowslinetermination(bool val) { - options.enable_windowslinetermination(val); + options._windowslinetermination = val; return *this; } diff --git a/cpp/tests/io/csv_test.cpp b/cpp/tests/io/csv_test.cpp index fd56b7a2e7b0..770c5bb9d5c0 100644 --- a/cpp/tests/io/csv_test.cpp +++ b/cpp/tests/io/csv_test.cpp @@ -946,6 +946,23 @@ TEST_F(CsvReaderTest, Strings) view.column(1)); } +TEST_F(CsvReaderTest, WindowsLineTerminators) +{ + std::string const buffer{"1,alpha\r\n\r\n2,beta\r\n"}; + auto const options = cudf::io::csv_reader_options::builder( + cudf::io::source_info{cudf::host_span{ + reinterpret_cast(buffer.data()), buffer.size()}}) + .dtypes({data_type{type_id::INT64}, data_type{type_id::STRING}}) + .header(-1); + + auto const result = cudf::io::read_csv(options); + + cudf::test::fixed_width_column_wrapper const expected_values{1, 2}; + cudf::test::strings_column_wrapper const expected_names{"alpha", "beta"}; + cudf::test::table_view const expected{{expected_values, expected_names}}; + CUDF_TEST_EXPECT_TABLES_EQUAL(expected, result.tbl->view()); +} + TEST_F(CsvReaderTest, StringsQuotes) { std::vector names{"line", "verse"};