Skip to content

Commit

Permalink
Rename asJSON to toJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Hulette committed Jan 19, 2018
1 parent e20decd commit e761eee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion js/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class CountByResult extends Table implements DataFrame {
super({batches: [[values, counts]]});
}

asJSON(): Object {
toJSON(): Object {
let result: {[key: string]: number|null} = {};

for (let i = -1; ++i < this.length;) {
Expand Down
12 changes: 6 additions & 6 deletions js/test/unit/table-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ describe(`Table`, () => {
test(`countBy on dictionary returns the correct counts`, () => {
// Make sure countBy works both with and without the Col wrapper
// class
expect(table.countBy(col('dictionary')).asJSON()).toEqual({
expect(table.countBy(col('dictionary')).toJSON()).toEqual({
'a': 3,
'b': 2,
'c': 2,
});
expect(table.countBy('dictionary').asJSON()).toEqual({
expect(table.countBy('dictionary').toJSON()).toEqual({
'a': 3,
'b': 2,
'c': 2,
});
});
test(`countBy on dictionary with filter returns the correct counts`, () => {
expect(table.filter(col('i32').eq(1)).countBy('dictionary').asJSON()).toEqual({
expect(table.filter(col('i32').eq(1)).countBy('dictionary').toJSON()).toEqual({
'a': 1,
'b': 1,
'c': 1,
Expand Down Expand Up @@ -366,19 +366,19 @@ describe(`Table`, () => {
test(`countBy on dictionary returns the correct counts`, () => {
// Make sure countBy works both with and without the Col wrapper
// class
expect(table.countBy(col('dictionary')).asJSON()).toEqual({
expect(table.countBy(col('dictionary')).toJSON()).toEqual({
'a': 3,
'b': 3,
'c': 3,
});
expect(table.countBy('dictionary').asJSON()).toEqual({
expect(table.countBy('dictionary').toJSON()).toEqual({
'a': 3,
'b': 3,
'c': 3,
});
});
test(`countBy on dictionary with filter returns the correct counts`, () => {
expect(table.filter(col('i32').eq(1)).countBy(col('dictionary')).asJSON()).toEqual({
expect(table.filter(col('i32').eq(1)).countBy(col('dictionary')).toJSON()).toEqual({
'a': 1,
'b': 2,
'c': 1,
Expand Down

0 comments on commit e761eee

Please sign in to comment.