Skip to content

feat(processors): auto-detect delimiter for CSV/TSV/DSV files#3414

Merged
igorDykhta merged 2 commits into
masterfrom
igr/auto-detect-delimeter
May 5, 2026
Merged

feat(processors): auto-detect delimiter for CSV/TSV/DSV files#3414
igorDykhta merged 2 commits into
masterfrom
igr/auto-detect-delimeter

Conversation

@igorDykhta
Copy link
Copy Markdown
Collaborator

Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Copilot AI review requested due to automatic review settings May 5, 2026 00:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 in processCsvData() to select the correct d3-dsv parser (CSV/TSV/custom DSV).
  • Extends default accepted file extensions/formats to include tsv and dsv.
  • 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.

Comment thread src/processors/src/data-processor.ts Outdated
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
@igorDykhta igorDykhta requested a review from lixun910 May 5, 2026 01:00
@igorDykhta igorDykhta added 3.3 Kepler.gl 3.3 release labels May 5, 2026
@igorDykhta igorDykhta merged commit d9f8adf into master May 5, 2026
8 checks passed
@igorDykhta igorDykhta deleted the igr/auto-detect-delimeter branch May 5, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.3 Kepler.gl 3.3 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants