Skip to content

Commit

Permalink
pass inputs and outputs schema through when creating the clone
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Aug 21, 2024
1 parent 40b67a5 commit 26a15a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3641,6 +3641,7 @@ export class Client {
});

const ds = await sourceClient.readSharedDataset(tokenUuid);
console.log("DATASET!", ds);
const finalDatasetName = datasetName || ds.name;

try {
Expand All @@ -3660,6 +3661,8 @@ export class Client {
const dataset = await this.createDataset(finalDatasetName, {
description: ds.description,
dataType: ds.data_type || "kv",
inputsSchema: ds.inputs_schema_definition ?? undefined,
outputsSchema: ds.outputs_schema_definition ?? undefined,
});
try {
await this.createExamples({
Expand Down
2 changes: 2 additions & 0 deletions js/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ export interface Dataset extends BaseDataset {
example_count?: number;
session_count?: number;
last_session_start_time?: number;
inputs_schema_definition?: KVMap;
outputs_schema_definition?: KVMap;
}
export interface DatasetShareSchema {
dataset_id: string;
Expand Down
2 changes: 1 addition & 1 deletion js/src/tests/client.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ test("list shared examples can list shared examples", async () => {
expect(sharedExamples.length).toBeGreaterThan(0);
});

test("clonePublicDataset method can clone a dataset", async () => {
test.only("clonePublicDataset method can clone a dataset", async () => {
const client = new Client();
const datasetName = "multiverse_math_public_testing";
const multiverseMathPublicDatasetURL =
Expand Down

0 comments on commit 26a15a6

Please sign in to comment.