def copy_table(session, model_cls): rows = session.query(model_cls).all() rows = list(map(lambda x: vars(x), rows)) op.bulk_insert(model_cls.__table__, rows)