Skip to content

✨ feat(csv): add PSV (Pipe-Separated Values) support and tests#1355

Merged
harehare merged 1 commit intomainfrom
feat/csv-psv-support
Feb 28, 2026
Merged

✨ feat(csv): add PSV (Pipe-Separated Values) support and tests#1355
harehare merged 1 commit intomainfrom
feat/csv-psv-support

Conversation

@harehare
Copy link
Copy Markdown
Owner

  • Add psv_parse function to csv.mq
  • Add module tests for PSV parsing and conversion
  • Ensures parity with CSV/TSV features

Closes #1352

- Add psv_parse function to csv.mq
- Add module tests for PSV parsing and conversion
- Ensures parity with CSV/TSV features

Closes #1352
Copilot AI review requested due to automatic review settings February 28, 2026 00:31
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 Pipe-Separated Values (PSV) parsing support to the csv mq module and extends the module test suite to validate PSV parsing/conversion behavior, aligning it with existing CSV/TSV ergonomics.

Changes:

  • Add csv::psv_parse(input, has_header) as a delimiter-specific wrapper around the shared CSV parser.
  • Add module tests covering PSV parsing into dict/array forms and PSV→JSON conversion.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/mq-lang/modules/csv.mq Adds psv_parse wrapper using `
crates/mq-lang/modules/module_tests.mq Adds PSV test cases for parsing (dict/array) and PSV→JSON conversion.

Comment on lines +33 to +38
| let psv_input = "a|b|c\n\"1,2\"|\"2,3\"|\"3,4\"\n4|5|6\n\"multi\nline\"|7|8\n9|10|\"quoted,comma\"\n\"\"|11|12\n13|14|15\n" |

def test_psv_parse_for_dict():
let result = csv::psv_parse(psv_input, true)
| assert_eq(len(result), 6)
end
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

PSV tests currently mirror the CSV cases and don’t cover PSV-specific edge cases (e.g., unquoted commas inside fields, or a literal | inside a quoted field). Adding at least one row like a|"b|c"|d (and/or 1,2|3,4|5,6 without quotes) would better validate that psv_parse correctly treats | as the delimiter and respects quoting.

Copilot generated this review using guidance from repository custom instructions.
@harehare harehare merged commit 9ca12dc into main Feb 28, 2026
8 checks passed
@harehare harehare deleted the feat/csv-psv-support branch February 28, 2026 00:44
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.

Add PSV Support

2 participants