def assert_status(func):
    @wraps(func)
    def wrapper(*args, **kw):
        result = json.loads(func(*args, **kw))
        if result['status'] == 1:
            if result.get('results') is not None:
                return result['results']
            elif result.get('result') is not None:
                return result['result']
            return result
        elif result['status'] == -1:
            raise Exception('BSVE request failed with %s' % result['errors'])
        elif result['status'] != 0:
            raise Exception(
                'Unexpected status from BSVE %s.' % str(result['status'])
            )
        return None
    return wrapper
According to spec TDS does not support output TVP values
dataset/ETHPy150Open Kitware/minerva/server/utility/bsve/bsve_utility.py/assert_status--crossover with--dataset/ETHPy150Open denisenkom/pytds/pytds/tds_types.py/Table.from_stream