Skip to content

Commit e761eee

Browse files
author
Brian Hulette
committed
Rename asJSON to toJSON
1 parent e20decd commit e761eee

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

js/src/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export class CountByResult extends Table implements DataFrame {
260260
super({batches: [[values, counts]]});
261261
}
262262

263-
asJSON(): Object {
263+
toJSON(): Object {
264264
let result: {[key: string]: number|null} = {};
265265

266266
for (let i = -1; ++i < this.length;) {

js/test/unit/table-tests.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,19 @@ describe(`Table`, () => {
161161
test(`countBy on dictionary returns the correct counts`, () => {
162162
// Make sure countBy works both with and without the Col wrapper
163163
// class
164-
expect(table.countBy(col('dictionary')).asJSON()).toEqual({
164+
expect(table.countBy(col('dictionary')).toJSON()).toEqual({
165165
'a': 3,
166166
'b': 2,
167167
'c': 2,
168168
});
169-
expect(table.countBy('dictionary').asJSON()).toEqual({
169+
expect(table.countBy('dictionary').toJSON()).toEqual({
170170
'a': 3,
171171
'b': 2,
172172
'c': 2,
173173
});
174174
});
175175
test(`countBy on dictionary with filter returns the correct counts`, () => {
176-
expect(table.filter(col('i32').eq(1)).countBy('dictionary').asJSON()).toEqual({
176+
expect(table.filter(col('i32').eq(1)).countBy('dictionary').toJSON()).toEqual({
177177
'a': 1,
178178
'b': 1,
179179
'c': 1,
@@ -366,19 +366,19 @@ describe(`Table`, () => {
366366
test(`countBy on dictionary returns the correct counts`, () => {
367367
// Make sure countBy works both with and without the Col wrapper
368368
// class
369-
expect(table.countBy(col('dictionary')).asJSON()).toEqual({
369+
expect(table.countBy(col('dictionary')).toJSON()).toEqual({
370370
'a': 3,
371371
'b': 3,
372372
'c': 3,
373373
});
374-
expect(table.countBy('dictionary').asJSON()).toEqual({
374+
expect(table.countBy('dictionary').toJSON()).toEqual({
375375
'a': 3,
376376
'b': 3,
377377
'c': 3,
378378
});
379379
});
380380
test(`countBy on dictionary with filter returns the correct counts`, () => {
381-
expect(table.filter(col('i32').eq(1)).countBy(col('dictionary')).asJSON()).toEqual({
381+
expect(table.filter(col('i32').eq(1)).countBy(col('dictionary')).toJSON()).toEqual({
382382
'a': 1,
383383
'b': 2,
384384
'c': 1,

0 commit comments

Comments
 (0)