Skip to content

fix(csv): partition_csv() raises on long lines - #2998

Merged
scanny merged 1 commit into
mainfrom
scanny/fix-2643-csv-detect-delimiter
May 10, 2024
Merged

scanny merged 1 commit into
mainfrom
scanny/fix-2643-csv-detect-delimiter

Conversation

@scanny

@scanny scanny commented May 9, 2024 •

Copy link
Copy Markdown
Contributor

Summary
The CSV delimiter-sniffer requires whole lines to properly detect the delimiter character. Limiting bytes read produced partial lines when lines were very long. Limit bytes but read whole lines.

Fixes #2643.

@sentry

sentry Bot commented May 9, 2024

Copy link
Copy Markdown

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: unstructured/partition/csv.py

Function Unhandled Issue
partition_csv Error: Could not determine delimiter /general/v0/...
Event Count: 9

Did you find this useful? React with a 👍 or 👎

@scanny
scanny requested review from Coniferish and awalker4 and removed request for awalker4 May 9, 2024 23:40
@scanny
scanny force-pushed the scanny/fix-2643-csv-detect-delimiter branch from 17c9e21 to 3304543 Compare May 10, 2024 00:21

@Coniferish Coniferish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The CSV delimiter-sniffer requires whole lines to properly detect the
delimiter character. Limiting bytes read produced partial lines when
lines were very long. Limit bytes but read whole lines.
@scanny
scanny force-pushed the scanny/fix-2643-csv-detect-delimiter branch from 3304543 to f4e11f9 Compare May 10, 2024 17:38
@scanny
scanny added this pull request to the merge queue May 10, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 10, 2024
@scanny
scanny added this pull request to the merge queue May 10, 2024
Merged via the queue into main with commit e4c8959 May 10, 2024
@scanny
scanny deleted the scanny/fix-2643-csv-detect-delimiter branch May 10, 2024 21:53

This branch was previously deployed

1 inactive deployment
ci — f4e11f91 Deployed May 10, 2024 by scanny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug/get_delimiter() fails when file read stops in the middle of a line

2 participants