def convert_to_correct_type(data):
    """
    Takes a string and returns in the correct type, int, float or string

    :param string data: input string to check
    :return string: the converted string

    :raise ValueError: We accept only non list or dict
    """
    if type(data) == list or type(data) == dict:
        raise ValueError('Incorrect type received %s' % type(data))
    if data:
        if type(data) == int or type(data) == float:
            return data
        try:
            return int(data)
        except ValueError:
            pass
        try:
            return float(data)
        except ValueError:
            pass
    elif data is None:
        return ''
    return data
