title: sqlalchemy bulk update fails
body: <p>I have a table = foo (minimal example below):</p>
  
  <pre><code>house       processed
  ----------  ----------
  95.0
  10.0
  63.0
  6.0
  55.0
  1.0
  19.0
  1.0
  30.0
  21.0
  sprite
  </code></pre>
  
  <p>I want to change decimal values to integers and find out when there is a non-numeric value in that column. I have tried with the <code>query.filter().update()</code> construct and while that gives me what I want, for 100k rows it takes forever. I understood <code>bulk_update</code> can help me. But I might be doing something wrong. My code is:</p>
  
  <pre><code>class foo(Base):
      __tablename__ = "foo"
      rowid = Column(Integer, primary_key=True)
      house = Column(Float)
      processed = Column(String(255))
  
  mappings = []
  for idx, s in enumerate(session.query(foo), start=1):    
      if type(s.house) in (int, float):
          replace = int(s.house)            
          info = {'processed':replace}
      else:
          info = {'processed':'not number'}        
      mappings.append(info)  
  session.bulk_update_mappings(foo, mappings)
  session.commit()
  </code></pre>
  
  <blockquote>
    <p>mappings [{'processed': 95}, {'processed': 10}, {'processed': 63}, {'processed': 6}, {'processed': 55}, {'processed': 1}, {'processed':
    19}, {'processed': 1}, {'processed': 30}, {'processed': 21},
    {'processed': 'not number'}]</p>
  </blockquote>
  
  <p>This gives me an error:</p>
  
  <blockquote>
    <p>UPDATE statement on table 'foo' expected to update 11 row(s); 0 were
    matched</p>
  </blockquote>
  
  <p>Full error:</p>
  
  <pre><code>session.bulk_update_mappings(foo, mappings)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "C:\Users\M64H098\repo\Enrichments-bag\lib\site-packages\sqlalchemy\orm\session.py", line 2868, in bulk_update_mappings
      self._bulk_save_mappings(
    File "C:\Users\M64H098\repo\Enrichments-bag\lib\site-packages\sqlalchemy\orm\session.py", line 2885, in _bulk_save_mappings
      transaction = self.begin(subtransactions=True)
    File "C:\Users\M64H098\repo\Enrichments-bag\lib\site-packages\sqlalchemy\orm\session.py", line 947, in begin
      self.transaction = self.transaction._begin(nested=nested)
    File "C:\Users\M64H098\repo\Enrichments-bag\lib\site-packages\sqlalchemy\orm\session.py", line 316, in _begin
      self._assert_active()
    File "C:\Users\M64H098\repo\Enrichments-bag\lib\site-packages\sqlalchemy\orm\session.py", line 288, in _assert_active
      raise sa_exc.InvalidRequestError(
  sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: UPDATE statement on table 'foo' expected to update 11 row(s); 0 were matched. (Background on this error at: http://sqlalche.me/e/7s2a)
  </code></pre>
  
  <p>What can I do to update the <code>processed</code> column in-place in bulk with the <code>mapping</code> dictionary?</p>