@@ -28,10 +28,13 @@ function json_key_attributes_to_dataframe(str) {
2828 const dtypes = [ new Int32 , new Float32 , new Float32 , new Int32 , new Utf8String , new Utf8String ] ;
2929 const no_open_list = str . split ( '[\n' ) . gather ( [ 1 ] , false ) ;
3030 const tokenized = no_open_list . split ( '},' ) ;
31+ const keys = tokenized . getJSONObject ( '.key' ) ;
32+ keys . setNullMask ( 1 , 0 ) ;
33+ arr [ 'key' ] = keys . cast ( new Int32 ) ;
3134 columns . forEach ( ( col , ix ) => {
3235 const parse_result = tokenized . getJSONObject ( '.attributes.' + columns [ ix ] ) ;
33- const string_array = Series . new ( parse_result ) ;
34- arr [ col ] = string_array . cast ( dtypes [ ix ] ) ;
36+ parse_result . setNullMask ( [ ] , 0 ) ;
37+ arr [ col ] = parse_result . cast ( dtypes [ ix ] ) ;
3538 } ) ;
3639 const result = new DataFrame ( arr ) ;
3740 return result ;
@@ -43,7 +46,8 @@ function json_aos_to_dataframe(str, columns, dtypes) {
4346 const no_open_list = str . split ( '[\n' ) . gather ( [ 1 ] , false ) ;
4447 const tokenized = no_open_list . split ( '},' ) ;
4548 const parse_result = tokenized . getJSONObject ( '.' + columns [ ix ] ) ;
46- arr [ col ] = Series . new ( parse_result ) . cast ( dtypes [ ix ] ) ;
49+ parse_result . setNullMask ( 1 , 0 ) ;
50+ arr [ col ] = parse_result . cast ( dtypes [ ix ] ) ;
4751 } ) ;
4852 const result = new DataFrame ( arr ) ;
4953 return result ;
@@ -56,8 +60,8 @@ function json_aoa_to_dataframe(str, dtypes) {
5660 dtypes . forEach ( ( _ , ix ) => {
5761 const get_ix = `[${ ix } ]` ;
5862 const parse_result = tokenized . getJSONObject ( get_ix ) ;
59- const string_array = Series . new ( parse_result ) ;
60- arr [ ix ] = string_array . cast ( dtypes [ ix ] ) ;
63+ parse_result . setNullMask ( [ ] , 0 ) ;
64+ arr [ ix ] = parse_result . cast ( dtypes [ ix ] ) ;
6165 } ) ;
6266 const result = new DataFrame ( arr ) ;
6367 return result ;
@@ -99,7 +103,7 @@ module.exports = {
99103 const tnodes = split . gather ( [ 1 ] , false ) ;
100104 const nodes = json_key_attributes_to_dataframe ( tnodes ) ;
101105 const edges = json_aos_to_dataframe (
102- tedges , [ 'key' , 'source' , 'target' ] , [ new Utf8String , new Int32 , new Int32 ] ) ;
106+ tedges , [ 'key' , 'source' , 'target' ] , [ new Utf8String , new Int64 , new Int64 ] ) ;
103107 let optionsArr = { } ;
104108 optionsArr [ 'type' ] = Series . new ( toptions . getJSONObject ( '.type' ) ) ;
105109 optionsArr [ 'multi' ] = Series . new ( toptions . getJSONObject ( '.multi' ) ) ;
@@ -129,7 +133,7 @@ module.exports = {
129133 const tnodes = split . gather ( [ 1 ] , false ) ;
130134 const tags = json_aos_to_dataframe ( ttags , [ 'key' , 'image' ] , [ new Utf8String , new Utf8String ] ) ;
131135 const clusters = json_aos_to_dataframe (
132- tclusters , [ 'key' , 'color' , 'clusterLabel' ] , [ new Int32 , new Utf8String , new Utf8String ] ) ;
136+ tclusters , [ 'key' , 'color' , 'clusterLabel' ] , [ new Int64 , new Utf8String , new Utf8String ] ) ;
133137 const nodes =
134138 json_aos_to_dataframe ( tnodes , [ 'key' , 'label' , 'tag' , 'URL' , 'cluster' , 'x' , 'y' , 'score' ] , [
135139 new Utf8String ,
0 commit comments