def go(): for i in range(100): # NOTE: this test was broken in # 77f1b7d236dba6b1c859bb428ef32d118ec372e6 because we started # clearing out the attributes after the first iteration. make # sure the attributes are there every time. assert compile_state.attributes exec_opts = {} bind_arguments = {} ORMCompileState.orm_pre_session_exec( sess, compile_state.select_statement, {}, exec_opts, bind_arguments, is_reentrant_invoke=False, ) r = sess.connection().execute( compile_state.statement, execution_options=exec_opts, ) r.context.compiled.compile_state = compile_state obj = ORMCompileState.orm_setup_cursor_result( sess, compile_state.statement, {}, exec_opts, {}, r, ) list(obj.unique()) sess.close()
def go(): for i in range(100): exec_opts = {} bind_arguments = {} ORMCompileState.orm_pre_session_exec(sess, compile_state.query, exec_opts, bind_arguments) r = sess.connection().execute( compile_state.statement, execution_options=exec_opts, bind_arguments=bind_arguments, ) r.context.compiled.compile_state = compile_state obj = ORMCompileState.orm_setup_cursor_result(sess, {}, r) list(obj) sess.close()