feat(processors): auto-detect delimiter for CSV/TSV/DSV files#3414
Merged
Conversation
Collaborator
igorDykhta
commented
May 5, 2026
- Add automatic delimiter detection to processCsvData so that files using tabs, semicolons, or pipe characters as delimiters are parsed correctly without requiring any user configuration.
- instead of the stale feat(processors): auto-detect delimiter for CSV/TSV/DSV files #3334 with extra tests and fixes
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds delimiter auto-detection to the processors CSV path so tab/semicolon/pipe-delimited text can be parsed without user configuration, and updates the UI’s accepted extensions accordingly.
Changes:
- Introduces
detectDelimiter()and uses it inprocessCsvData()to select the correctd3-dsvparser (CSV/TSV/custom DSV). - Extends default accepted file extensions/formats to include
tsvanddsv. - Adds extensive unit tests covering delimiter detection and parsing behavior across multiple delimiters and edge cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/node/utils/data-processor-test.js | Adds coverage for detectDelimiter and processCsvData parsing of TSV/SSV/PSV and edge cases. |
| src/reducers/src/vis-state-selectors.ts | Adds tsv/dsv to default extension + format lists exposed to the UI. |
| src/processors/src/data-processor.ts | Implements delimiter detection and switches CSV parsing to the detected DSV parser. |
Comments suppressed due to low confidence (1)
src/processors/src/data-processor.ts:167
- This error message now triggers for TSV/semicolon/pipe-delimited inputs as well, but it still says “CSV is empty”. Please update it to a delimiter-agnostic message (e.g. “DSV is empty” / “delimited text is empty”) so users get accurate feedback.
if (!Array.isArray(parsedRows) || parsedRows.length < 2) {
// looks like an empty file, throw error to be catch
throw new Error('process Csv Data Failed: CSV is empty');
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lixun910
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.