@@ -64,9 +64,7 @@ async def main():
6464 odf = await connection .fetch_df_all (statement = SQL , arraysize = 100 )
6565
6666 # Get a Pandas DataFrame from the data
67- df = pyarrow .Table .from_arrays (
68- odf .column_arrays (), names = odf .column_names ()
69- ).to_pandas ()
67+ df = pyarrow .table (odf ).to_pandas ()
7068
7169 # Perform various Pandas operations on the DataFrame
7270
@@ -96,9 +94,7 @@ async def main():
9694 # Tune 'size' for your data set. Here it is small to show the batch fetch
9795 # behavior on the sample table.
9896 async for odf in connection .fetch_df_batches (statement = SQL , size = 10 ):
99- df_b = pyarrow .Table .from_arrays (
100- odf .column_arrays (), names = odf .column_names ()
101- ).to_pandas ()
97+ df_b = pyarrow .table (odf ).to_pandas ()
10298 print (f"Appending { df_b .shape [0 ]} rows" )
10399 df = pandas .concat ([df , df_b ], ignore_index = True )
104100
@@ -141,9 +137,7 @@ async def main():
141137 odf = await connection .fetch_df_all (statement = sql , arraysize = 100 )
142138
143139 # Get a Pandas DataFrame from the data
144- df = pyarrow .Table .from_arrays (
145- odf .column_arrays (), names = odf .column_names ()
146- ).to_pandas ()
140+ df = pyarrow .table (odf ).to_pandas ()
147141
148142 # Perform various Pandas operations on the DataFrame
149143
0 commit comments