def assert_not_null(attribute, value):
    """Asserts that the given object is non-null and returns it.

    :param attribute: Object to assert on
    :param value: Field name to display in exception message if null
    :return: Object if non null
    :raises: ValueError if object is null
    """
    if not attribute:
        raise ValueError('{} is null'.format(value))
    return attribute
