#NEWLINE# def dontruntest_big_csvs( ) : #NEWLINE# #INDENT# cols = [ ] #NEWLINE# cols . append ( Column ( name = 'name' , columnType = 'STRING' , maximumSize = 1000 ) ) #NEWLINE# cols . append ( Column ( name = 'foo' , columnType = 'STRING' , enumValues = [ 'foo' , 'bar' , 'bat' ] ) ) #NEWLINE# cols . append ( Column ( name = 'x' , columnType = 'DOUBLE' ) ) #NEWLINE# cols . append ( Column ( name = 'n' , columnType = 'INTEGER' ) ) #NEWLINE# cols . append ( Column ( name = 'is_bogus' , columnType = 'BOOLEAN' ) ) #NEWLINE# schema1 = syn . store ( Schema ( name = 'Big Table' , columns = cols , parent = project ) ) #NEWLINE# print ( 'Created table:' , schema1 . id ) #NEWLINE# print ( 'with columns:' , schema1 . columnIds ) #NEWLINE# with tempfile . NamedTemporaryFile ( delete = False ) as temp : #NEWLINE# #INDENT# schedule_for_cleanup ( temp . name ) #NEWLINE# filename = temp . name #NEWLINE# #UNINDENT# with io . open ( filename , mode = 'w' , encoding = 'utf-8' , newline = '' ) as temp : #NEWLINE# #INDENT# writer = csv . writer ( temp , quoting = csv . QUOTE_NONNUMERIC , lineterminator = str ( os . linesep ) ) #NEWLINE# writer . writerow ( [ col . name for col in cols ] ) #NEWLINE# for i in range ( 10 ) : #NEWLINE# #INDENT# for j in range ( 100 ) : #NEWLINE# #INDENT# foo = cols [ 1 ] . enumValues [ random . randint ( 0 , 2 ) ] #NEWLINE# writer . writerow ( ( ( 'Robot ' + str ( ( ( i * 100 ) + j ) ) ) , foo , ( random . random ( ) * 200.0 ) , random . randint ( 0 , 100 ) , ( random . random ( ) >= 0.5 ) ) ) #NEWLINE# #UNINDENT# print ( 'wrote 100 rows to disk' ) #NEWLINE# #UNINDENT# #UNINDENT# UploadToTableResult = syn . _uploadCsv ( filepath = temp . name , schema = schema1 ) #NEWLINE# from synapseclient.table import CsvFileTable #NEWLINE# results = CsvFileTable . from_table_query ( syn , ( 'select * from %s' % schema1 . id ) ) #NEWLINE# print ( 'etag:' , results . etag ) #NEWLINE# print ( 'tableId:' , results . tableId ) #NEWLINE# for row in results : #NEWLINE# #INDENT# print ( row )