CSV: a custom delimiter in the sep= hint is rejected
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Find the CSV backend and inspect how it parses the first-line sep= hint versus how it uses _DELIMITERS for csv.Sniffer. Run the reproduction with ^ and a space, then add or update CSV conversion tests for those delimiters and for mixed-case SEP=. Done means each hinted delimiter converts and the resulting table contains the four expected cells.
Written by the indexing model from the issue text.
Description
Bug
The CSV backend honors Excel's sep=<char> first line, but only when the character is one of the candidates used for delimiter sniffing (, ; tab | :). A file whose explicit hint names any other single character, such as ^ or a space, fails to convert with Cannot convert csv with unknown delimiter ^.
The hint names the delimiter, so the sniffer's candidate list must not apply to it. _DELIMITERS is documented as the characters handed to csv.Sniffer. The check that uses it was unreachable for a sniffed dialect, because the sniffer can only return one of those characters.
Steps to reproduce
from io import BytesIO
from docling.datamodel.base_models import DocumentStream
from docling.document_converter import DocumentConverter
for delimiter in ["^", " "]:
text = f"sep={delimiter}\nName{delimiter}Price\nApple{delimiter}1.50\n"
result = DocumentConverter().convert(
DocumentStream(name="custom.csv", stream=BytesIO(text.encode())),
raises_on_error=False,
)
message = result.errors[0].error_message if result.errors else ""
print(repr(delimiter), result.status, message)
Actual:
'^' ConversionStatus.FAILURE Cannot convert csv with unknown delimiter ^.
' ' ConversionStatus.FAILURE Cannot convert csv with unknown delimiter .
Expected: both files convert, and each table holds the cells Name, Price, Apple, 1.50.
The same failure occurs with an explicit SEP= hint in any letter case.
Docling version
2.150.0 (main 1ae470a)
Python version
3.12.14
- Dominant language
- Python
- Stars
- 71k
- Forks
- 5.4k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 161
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docling-project/docling
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
docling-project/docling#5592 ·
Maintainers usually reply within 2 days
-
`api_image_request` logs and propagates the raw error response body, leaking the request's API key on 401Possibly taken @prassu017 claimed this 7 days ago. Openbug priority:critical
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
docling-project/docling#5486 · 1 comment · 1 reaction ·
Maintainers usually reply within 2 days
-
AFP: export_to_doctags() raises ZeroDivisionError because every page has size 0x0Possibly taken @Krushil-Dhankecha claimed this 12 days ago. Openbug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
docling-project/docling#5355 · 1 comment ·
Maintainers usually reply within 2 days
-
AsciiDoc: thematic breaks and page breaks are kept as text or turned into list itemsPossibly taken @sohailshk claimed this 12 days ago. Openasciidoc bug priority:low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
docling-project/docling#5331 · 1 comment ·
Maintainers usually reply within 2 days
-
Merged paragraph across pages of different heights: continuation bbox uses the first page's heightPossibly taken @galer1us claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
docling-project/docling#5286 ·
Maintainers usually reply within 2 days
All issues in docling-project/docling
Similar issues
-
Task select patterns with uppercase letters never matchPossibly taken @manobhisriram claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: housekeeping
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
netbox-community/netbox-scripts#239 ·
Maintainers usually reply within 1 day
-
Lambda deploys fail once the bundle grows by about 254 KBPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
developmentseed/titiler-cmr#341 ·
Maintainers usually reply within 1 day
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 charactersPossibly taken @omkarbandikatte claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day