#NEWLINE# def _test_file_json( self , parquet_file , csv_file ) : #NEWLINE# #INDENT# ' Given the parquet_file and csv_file representation, converts the\n            parquet_file to json using the dump utility and then compares the\n            result to the csv_file using column agnostic ordering.\n        ' #NEWLINE# expected_data = [ ] #NEWLINE# with open ( csv_file , 'rb' ) as f : #NEWLINE# #INDENT# expected_data = list ( csv . reader ( f , delimiter = '|' ) ) #NEWLINE# #UNINDENT# actual_raw_data = StringIO . StringIO ( ) #NEWLINE# parquet . dump ( parquet_file , Options ( format = 'json' ) , out = actual_raw_data ) #NEWLINE# actual_raw_data . seek ( 0 , 0 ) #NEWLINE# actual_data = [ json . loads ( x . rstrip ( ) ) for x in actual_raw_data . read ( ) . split ( '\n' ) if ( len ( x ) > 0 ) ] #NEWLINE# assert ( len ( expected_data ) == len ( actual_data ) ) #NEWLINE# footer = parquet . read_footer ( parquet_file ) #NEWLINE# cols = [ s . name for s in footer . schema ] #NEWLINE# for ( expected , actual ) in zip ( expected_data , actual_raw_data ) : #NEWLINE# #INDENT# assert ( len ( expected ) == len ( actual ) ) #NEWLINE# for ( i , c ) in enumerate ( cols ) : #NEWLINE# #INDENT# if ( c in actual ) : #NEWLINE# #INDENT# assert ( expected [ self ] == actual [ c ] )