Skip to content

Parse tables from CSV, TSV, and fixed space delimted formats#38

Merged
atsyplenkov merged 4 commits intoatsyplenkov:masterfrom
juarezr:feat/csv
Sep 11, 2025
Merged

Parse tables from CSV, TSV, and fixed space delimted formats#38
atsyplenkov merged 4 commits intoatsyplenkov:masterfrom
juarezr:feat/csv

Conversation

@juarezr
Copy link
Contributor

@juarezr juarezr commented Sep 9, 2025

Changes

  • Besides TAB-delimited, make Pastrum also parse text from the following formats
    • CSV
    • TSV
    • Fixed Length (delimited by spaces)
  • Choose what format best parses the input data
  • Fix conversion when the table has any row with missing columns

@atsyplenkov
Copy link
Owner

Thanks for the PR. This addition looks very promising. I will review it later this week. First, I want to create some CI workflow to ensure that new features we are implementing will not crash the extension.

@atsyplenkov atsyplenkov self-requested a review September 10, 2025 22:23
@atsyplenkov
Copy link
Owner

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, please upgrade to Bugbot Pro by visiting the Cursor dashboard. Your first 14 days will be free!

if (type === "string") {
const values = data.map((row) => row[colIndex]).filter(value => value !== "");
const allBool = values.every((value) => utils.isBool(value));
const allBool = values.every((value) => value && utils.isBool(value));
Copy link

Choose a reason for hiding this comment

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

Bug: Falsy Values Excluded in Type Detection

The value && utils.isX(value) pattern in type detection incorrectly excludes legitimate falsy values (0, false) from integer and boolean type checks. This also creates an inconsistency for null and undefined values: they are ignored during initial counting but then cause type detection to fail because they are falsy and not filtered out before these checks.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@atsyplenkov atsyplenkov merged commit e79c806 into atsyplenkov:master Sep 11, 2025
2 checks passed
@atsyplenkov
Copy link
Owner

Dear @juarezr, many thanks for your contributions!

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.

2 participants