Lukabura/epd 2130 allow dataset attributes to be renamed javascript sdk update #305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
UpdateDatasetV2Requestinterface and corresponding test coverage. The main change is the addition of a minimal interface insrc/datasets-v2/types/index.tsthat contains only aschemaproperty of typeSchemaProperty[], 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
@ts-nocheckin tests which bypasses TypeScript safety checks and could hide type-related issues