apache / apache/arrow-js

[JS] Add DataFrame.toJSON

Open
#127 2 comments 0 reactions 0 assignees View on GitHub
Type: enhancement
Dominant language
TypeScript
Stars
112
Forks
23
Avg merge
21h 18m
Merged PRs (30d)
8

Description

Currently, `CountByResult` has its own [`toJSON` method](https://github.com/apache/arrow/blob/master/js/src/table.ts#L282), but there should be a more general one for every `DataFrame`.

`CountByResult.toJSON` returns:
```json

{
"keyA": 10,
"keyB": 10,
...
}
```

A more general `toJSON` could just return a list of objects with an entry for each column. For the above `CountByResult`, the output would look like:
```json

[
{value: "keyA", count: 10},
{value: "keyB", count: 10},
...
]
```

**Reporter**: [Brian Hulette](https://issues.apache.org/jira/browse/ARROW-2202) / @TheNeuralBit

**Note**: *This issue was originally created as [ARROW-2202](https://issues.apache.org/jira/browse/ARROW-2202). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.