Skip to content
Open
3 changes: 1 addition & 2 deletions cpp/benchmarks/io/csv/csv_reader_options.cpp
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down Expand Up @@ -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_");

Expand Down
24 changes: 21 additions & 3 deletions cpp/include/cudf/io/csv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down
17 changes: 17 additions & 0 deletions cpp/tests/io/csv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::byte const>{
reinterpret_cast<std::byte const*>(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<int64_t> 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<std::string> names{"line", "verse"};
Expand Down
Loading