Skip to content

CSV reader with new_line:='\r\n' should reject file with bare \r unless rfc_4180:=false #15783

@soerenwolfers

Description

@soerenwolfers

What happens?

CSV reader should reject file with bare \r unless rfc_4180:=false, but instead treats it as a line separator and returns a broken line.

To Reproduce

from duckdb import query

with open("/tmp/test.csv", "w") as f:
    f.write("""one\rtwo""")

query(r"""
SELECT * FROM read_csv('/tmp/test.csv', new_line:='\r\n', rfc_4180:=true)
""")
┌─────────┐
│   one   │
│ varchar │
├─────────┤
│ wo      │
└─────────┘

OS:

Ubuntu20

DuckDB Version:

v1.1.4-dev4760

DuckDB Client:

Python

Hardware:

.

Full Name:

Soeren Wolfers

Affiliation:

G-Research

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

Did you include all relevant data sets for reproducing the issue?

Not applicable - the reproduction does not require a data set

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions