Executing the SQL command through a cursor is a way that allows you to change arraysize .
The dummy_gen_function can be modified
conn = await session.connection()
cursor = conn.connection.cursor()
cursor.arraysize = 1000
result = cursor.execute("xxxxxx")