@with_connection
def _update(sql, args, post_fn=None):
    global _db_ctx, _db_convert
    cursor = None
    if _db_convert != '?':
        sql = sql.replace('?', _db_convert)
    _log((sql, args) % 'SQL: %s, ARGS: %s')
    start = time.time()
    try:
        cursor = _db_ctx.connection.cursor()
        cursor.execute(sql, args)
        r = cursor.rowcount
        if _db_ctx.transactions==0:
            # no transaction enviroment:
            _log('auto commit')
            _db_ctx.connection.commit()
            post_fn and post_fn()
        return r
    finally:
        if cursor:
            cursor.close()
        _profiling(start, sql)
dataset/ETHPy150Open michaelliao/transwarp/transwarp/db.py/_update/swapped operands of `%`