@staticmethod
def _conditions_column_index_to_name(conditions, idxdict, typesdict,
    allow_casting):
    """
        Changes the conditions contained in the list in the following way:
        column indexes will be substituted by names, while column names (strings) will
        be untouched. If casting is allowed conditions which requires casting will
        have a new field 'casted_to' added, mapped to 'numeric'.

        :param conditions:
        :type conditions: list
        :param idxdict: Dict mapping column indexes to names
        :type idxdict: dict
        :param typesdict: Dict mapping column names to a type
        :type typesdict: dict
        :param allow_casting: If casting a column to a type matching the 'value' field in condition is allowed
        :type allow_casting: bool
        """
    for cond in conditions:
        col = cond['column']
        if type(col) is int:
            assert 0 <= col < len(idxdict
                ), "column index '%s' out of range" % col
            cond['column'] = idxdict[col]
        if cond['column'] != '*' and typesdict[cond['column']
            ] == 'string' and type(cond['value']) != str:
            assert allow_casting, "Type of column '%s' is string, but 'value' %s is of numeric type, and casting is not allowed" % (
                col, cond['value'])
            vtype = type(cond['value'])
            cond['casted_to'] = 'double' if vtype is float else 'bigint'
