Skip to content

feat(closes OPEN-5988): openlayer-ts should accept csv datasets#178

Merged
gustavocidornelas merged 1 commit intomainfrom
siddhant/open-5988-openlayer-ts-should-accept-csv-datasets
Mar 23, 2026
Merged

feat(closes OPEN-5988): openlayer-ts should accept csv datasets#178
gustavocidornelas merged 1 commit intomainfrom
siddhant/open-5988-openlayer-ts-should-accept-csv-datasets

Conversation

@shah-siddd
Copy link
Copy Markdown

Pull Request

Summary

Adds CSV format support to the CLI dataset loading and writing functionality. The CLI now automatically detects and handles both JSON and CSV datasets based on file extension, maintaining format consistency between input and output files.

Changes

  • Added CSV parsing with proper quote and comma handling (parseCsv, parseCsvLine)
  • Added CSV serialization with automatic quoting for special characters (serializeCsv, escapeCsvValue)
  • Added format detection based on file extension (detectDatasetFormat)
  • Refactored loadDataset to support both JSON and CSV formats
  • Refactored writeDataset to preserve input format in output files
  • Updated CLIHandler to use the new format-aware dataset functions
  • Added comprehensive unit tests for CSV parsing, serialization, and round-trip operations

Context

Previously, the CLI only supported JSON datasets. This change enables users to work with CSV datasets, which are commonly used in data science workflows. The implementation handles edge cases like quoted values, commas within fields, and escaped quotes according to RFC 4180 standards.

Testing

  • Unit tests
  • Manual testing
  • Postman CI/CD
  • Other (please specify)

Test Coverage:

  • JSON dataset loading and writing
  • CSV dataset loading and writing
  • CSV parsing with quoted values and commas
  • CSV serialization with proper escaping
  • Round-trip CSV serialization/parsing

Monitoring

  • No expected impact
  • Added/updated relevant monitoring (Sentry alerts, logs, dashboards)

Notes

  • CSV values are automatically quoted when they contain commas, quotes, or newlines
  • CSV parsing handles escaped quotes ("") correctly
  • Output format matches input format (CSV input → CSV output, JSON input → JSON output)
  • All CSV parsing/serialization is implemented without external dependencies

@whoseoyster whoseoyster requested a review from vikasnair January 5, 2026 11:53
@shah-siddd shah-siddd force-pushed the siddhant/open-5988-openlayer-ts-should-accept-csv-datasets branch 3 times, most recently from 40c836a to 9b6c6c2 Compare January 28, 2026 06:36
Copy link
Copy Markdown
Contributor

@gustavocidornelas gustavocidornelas left a comment

Choose a reason for hiding this comment

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

Added a few comments to version.ts.

Also, can you discard all changes outside of src/lib? Everything outside of it is auto-generated by Stainless, so this will cause issues. Version updates and changelog are fully handled by them based on the commit messages.

I recently wrote more details about SDK maintenance. I'm sure you know most of the things but sending here just in case.

Also, in the PR description, you mention unit tests but I don't see any. Make sure the description is accurate

Comment thread .release-please-manifest.json Outdated
Comment thread CHANGELOG.md Outdated
Comment thread package.json Outdated
Comment thread package-lock.json
Comment thread src/version.ts Outdated
Comment thread src/lib/core/cli.ts Outdated
Comment thread src/lib/core/cli.ts Outdated
Comment thread src/lib/core/cli.ts Outdated
@shah-siddd shah-siddd force-pushed the siddhant/open-5988-openlayer-ts-should-accept-csv-datasets branch from 9b6c6c2 to cceb336 Compare March 23, 2026 08:36
@shah-siddd shah-siddd force-pushed the siddhant/open-5988-openlayer-ts-should-accept-csv-datasets branch from cceb336 to baf057c Compare March 23, 2026 08:40
@gustavocidornelas gustavocidornelas merged commit 5399658 into main Mar 23, 2026
5 checks passed
@gustavocidornelas gustavocidornelas deleted the siddhant/open-5988-openlayer-ts-should-accept-csv-datasets branch March 23, 2026 18:33
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