Skip to content

Conversation

@lukabura-ab
Copy link
Contributor

@lukabura-ab lukabura-ab commented Aug 19, 2025

The JavaScript SDK has been updated due to changes in version 2 regarding the renaming of attributes in datasets. Attribute names are no longer read-only and can now be modified.

Greptile Summary

This PR introduces support for renaming dataset attributes in the v2 datasets API by adding a new UpdateDatasetV2Request interface and corresponding test coverage. The main change is the addition of a minimal interface in src/datasets-v2/types/index.ts that contains only a schema property of type SchemaProperty[], enabling updates to dataset schemas while maintaining backward compatibility.

The implementation allows for flexible schema management where existing properties preserve their IDs during updates (maintaining referential integrity), while new properties automatically receive generated IDs using cuid2.createId(). The system enforces property name uniqueness validation before making API calls to prevent data corruption.

This change integrates seamlessly with the existing datasets-v2 architecture, extending the type system to support the new update functionality without breaking existing interfaces. The minimal design of the interface reflects the specific requirement of schema updates, focusing solely on the schema property rather than other dataset metadata like name or external ID.

Confidence score: 3/5

  • This PR introduces new functionality with potential edge cases that need careful validation in production
  • Score reflects the use of @ts-nocheck in tests which bypasses TypeScript safety checks and could hide type-related issues
  • Pay close attention to the test file's type safety bypassing and ensure the validation logic handles all edge cases correctly

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

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