Skip to content

feat(weave): Support properly retrieving a dataset back in TS SDK#5630

Merged
chance-wnb merged 1 commit intomasterfrom
chance/ts_dataset
Oct 30, 2025
Merged

feat(weave): Support properly retrieving a dataset back in TS SDK#5630
chance-wnb merged 1 commit intomasterfrom
chance/ts_dataset

Conversation

@chance-wnb
Copy link
Copy Markdown
Contributor

@chance-wnb chance-wnb commented Oct 27, 2025

Description

  • Implements loading for Dataset and Table objects in the TypeScript SDK
  • Adds URI parsing utilities for Weave references

This PR adds support for loading of Dataset and Table objects, allowing them to be retrieved from the server on demand. It includes a new URI parser for handling different types of Weave references

The implementation ensures that dataset rows can be accessed synchronously after loading.

The PR also extends the InMemoryTraceServer to support table operations for testing scenarios.

Testing

  • Added comprehensive tests for Dataset creation and retrieval
  • Implemented round-trip testing to verify data integrity
  • Extended InMemoryTraceServer to support table operations for testing

Docs:

wandb/docs#1809

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wandbot-3000
Copy link
Copy Markdown

wandbot-3000 Bot commented Oct 27, 2025

@chance-wnb chance-wnb changed the title Support reading a dataset properly feat(weave): Support properly retrieving a dataset back in TS SDK Oct 27, 2025
@chance-wnb chance-wnb marked this pull request as ready for review October 27, 2025 17:18
@chance-wnb chance-wnb requested a review from a team as a code owner October 27, 2025 17:18
Copy link
Copy Markdown
Collaborator

@neutralino1 neutralino1 left a comment

Choose a reason for hiding this comment

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

A few notes.

};
},

objReadObjReadPost: async (req: {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The name of these functions is strange. It duplicated objRead, can we do better?

Copy link
Copy Markdown
Contributor Author

@chance-wnb chance-wnb Oct 28, 2025

Choose a reason for hiding this comment

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

While you are saying it, I am shocked too.

But all these come from the auto-gen`ed http client stubs:

objReadObjReadPost: (data: ObjReadReq, params: RequestParams = {}) =>

And those have existed at least for a year.

I will ask Andrew tomorrow about why things are this way. but most likely it might be the way it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I investigated a bit. it turned out that we can fix that by putting some annotations on the server side FastAPI level.

Details are explained in https://weightsandbiases.slack.com/archives/C03BSTEBD7F/p1761668495870889

I'd suggest we tackle this as a tech debt item separately.

};

table = {
tableCreateTableCreatePost: async (req: {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same.

Comment on lines +190 to +194
// Create row entries with individual digests
const rows = req.table.rows.map(rowVal => ({
digest: this.generateDigest(rowVal),
val: rowVal,
}));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any performance concerns here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a test harness file. it will only be used in test cases. So I guess it should be fine.

};
},

tableQueryTableQueryPost: async (req: {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

strangeFunctionStrangeFunctionName

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

lol. I will investigate, but likely we might have to leave it as is.

Comment thread sdks/node/src/uriParser.ts
Comment on lines +40 to +52
* Parse a Weave URI into its components.
*
* @param uri - The weave:/// URI string to parse
* @returns Parsed URI components or null if invalid
*
* @example
* ```typescript
* const parsed = parseWeaveUri('weave:///wandb/project/table/abc123...');
* if (parsed && parsed.type === 'table') {
* console.log(parsed.digest); // 'abc123...'
* }
* ```
*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The definitive mark of vide-coded functions 😆

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Haha, yes. want me to change anything?

Copy link
Copy Markdown
Contributor Author

@chance-wnb chance-wnb left a comment

Choose a reason for hiding this comment

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

@neutralino1 Thanks so much for the code review! Many things weren't known to me. I investigated a bit and replied. Please kindly have another look!

};
},

objReadObjReadPost: async (req: {
Copy link
Copy Markdown
Contributor Author

@chance-wnb chance-wnb Oct 28, 2025

Choose a reason for hiding this comment

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

While you are saying it, I am shocked too.

But all these come from the auto-gen`ed http client stubs:

objReadObjReadPost: (data: ObjReadReq, params: RequestParams = {}) =>

And those have existed at least for a year.

I will ask Andrew tomorrow about why things are this way. but most likely it might be the way it is.

};
},

tableQueryTableQueryPost: async (req: {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

lol. I will investigate, but likely we might have to leave it as is.

Comment thread sdks/node/src/uriParser.ts
Comment on lines +40 to +52
* Parse a Weave URI into its components.
*
* @param uri - The weave:/// URI string to parse
* @returns Parsed URI components or null if invalid
*
* @example
* ```typescript
* const parsed = parseWeaveUri('weave:///wandb/project/table/abc123...');
* if (parsed && parsed.type === 'table') {
* console.log(parsed.digest); // 'abc123...'
* }
* ```
*/
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Haha, yes. want me to change anything?

@chance-wnb
Copy link
Copy Markdown
Contributor Author

The failed test case is known and irrelevant. merging.

@chance-wnb chance-wnb merged commit 08f7c8a into master Oct 30, 2025
716 of 726 checks passed
@chance-wnb chance-wnb deleted the chance/ts_dataset branch October 30, 2025 22:28
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants