title: Iterating over query results from sqlalchemy
body: <p>I have a sqlalchemy query function like this</p>
  
  <pre><code>def foo():
  local_session = Session()
  results = local_session.query(T.x, T.y, T.z, T.a, T.b, T.c
  , T.d, T.e, T.f, T.g, T.h, T.i, T.j, T.k, T.l
  , T.m, T.n, T.o, T.p, T.q, T.r, T.s, T.t, T.u
  , T.v, 
  User.gender).join(User)\
  .filter(T.language == 'en', T.where_i_am_from == 'US',
  User.some_num &gt;= 0.9).limit(1000000)
  
  local_session.close()
  return results, results.count()
  </code></pre>
  
  <p>The query works fine.
  and then I call this function here:</p>
  
  <pre><code>def fubar():
  
  raw_data,raw_data_length = myModule.foo()
  
  df = pd.DataFrame()
  for each in raw_data:
  
      df = df.append(pd.DataFrame({ #add each.x etc to df..... }}
  
  
  return df
  </code></pre>
  
  <p>The issue is that it wont iterate over the "for each in raw_data" loop when I have a .limit on my foo query above 5000, or use .all() or have no limit. The program will just hang and do nothing (0 cpu usage). I've tested this both on my local sql server and my amazon one. When I run the sql directly on the database I return around 800,000 rows.  Why is this happening? </p>
  
  <p>I'm using the latest mysql and latest sqlalchemy.</p>