> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: Dataset<R>

> TypeScript SDK reference

[weave](../) / Dataset

Dataset object with easy saving and automatic versioning

`Example`

```ts twoslash theme={null}
// @noErrors
// Create a dataset
const dataset = new Dataset({
  id: 'grammar-dataset',
  rows: [
    { id: '0', sentence: "He no likes ice cream.", correction: "He doesn't like ice cream." },
    { id: '1', sentence: "She goed to the store.", correction: "She went to the store." },
    { id: '2', sentence: "They plays video games all day.", correction: "They play video games all day." }
  ]
})

// Access a specific example
const exampleLabel = dataset.getRow(2).sentence;

// Save the dataset
const ref = await dataset.save()
```

## Type parameters

| Name | Type                 |
| :--- | :------------------- |
| `R`  | extends `DatasetRow` |

## Hierarchy

* [`WeaveObject`](./weaveobject)

  ↳ `Dataset`

## Table of contents

### Constructors

* [constructor](./dataset#constructor)

### Properties

* [\_\_savedRef](./dataset#__savedref)
* [rows](./dataset#rows)

### Accessors

* [description](./dataset#description)
* [length](./dataset#length)
* [name](./dataset#name)

### Methods

* [\[asyncIterator\]](./dataset#\[asynciterator])
* [getRow](./dataset#getrow)
* [save](./dataset#save)
* [saveAttrs](./dataset#saveattrs)

## Constructors

### constructor

• **new Dataset**\<`R`>(`parameters`): [`Dataset`](./dataset)\<`R`>

#### Type parameters

| Name | Type                 |
| :--- | :------------------- |
| `R`  | extends `DatasetRow` |

#### Parameters

| Name         | Type                      |
| :----------- | :------------------------ |
| `parameters` | `DatasetParameters`\<`R`> |

#### Returns

[`Dataset`](./dataset)\<`R`>

#### Overrides

[WeaveObject](./weaveobject).[constructor](./weaveobject#constructor)

#### Defined in

[src/dataset.ts:55](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/dataset.ts#L55)

## Properties

### \_\_savedRef

• `Optional` **\_\_savedRef**: [`ObjectRef`](./objectref) | `Promise`\<[`ObjectRef`](./objectref)>

#### Inherited from

[WeaveObject](./weaveobject).[\_\_savedRef](./weaveobject#__savedref)

#### Defined in

[src/weaveObject.ts:71](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveObject.ts#L71)

***

### rows

• **rows**: `Table`\<`R`>

#### Defined in

[src/dataset.ts:53](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/dataset.ts#L53)

## Accessors

### description

• `get` **description**(): `undefined` | `string`

#### Returns

`undefined` | `string`

#### Inherited from

WeaveObject.description

#### Defined in

[src/weaveObject.ts:98](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveObject.ts#L98)

***

### length

• `get` **length**(): `number`

#### Returns

`number`

#### Defined in

[src/dataset.ts:68](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/dataset.ts#L68)

***

### name

• `get` **name**(): `string`

#### Returns

`string`

#### Inherited from

WeaveObject.name

#### Defined in

[src/weaveObject.ts:94](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveObject.ts#L94)

## Methods

### \[asyncIterator]

▸ **\[asyncIterator]**(): `AsyncIterator`\<`any`, `any`, `any`>

#### Returns

`AsyncIterator`\<`any`, `any`, `any`>

#### Defined in

[src/dataset.ts:72](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/dataset.ts#L72)

***

### getRow

▸ **getRow**(`index`): `R`

#### Parameters

| Name    | Type     |
| :------ | :------- |
| `index` | `number` |

#### Returns

`R`

#### Defined in

[src/dataset.ts:78](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/dataset.ts#L78)

***

### save

▸ **save**(): `Promise`\<[`ObjectRef`](./objectref)>

#### Returns

`Promise`\<[`ObjectRef`](./objectref)>

#### Defined in

[src/dataset.ts:64](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/dataset.ts#L64)

***

### saveAttrs

▸ **saveAttrs**(): `Object`

#### Returns

`Object`

#### Inherited from

[WeaveObject](./weaveobject).[saveAttrs](./weaveobject#saveattrs)

#### Defined in

[src/weaveObject.ts:75](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveObject.ts#L75)
