return a dict of the kinds allowable columns for this object
517671
def queryables(self):
        

        # compute the values_axes queryables
        return dict(
            [(a.cname, a) for a in self.index_axes] +
            [(self.storage_obj_type._AXIS_NAMES[axis], None)
             for axis, values in self.non_index_axes] +
            [(v.cname, v) for v in self.values_axes
             if v.name in set(self.data_columns)]
        )
1061637
def optional(cls):
        
        columns = []
        for column in cls.__table__.columns:  # pylint: disable=no-member
            if column.nullable:
                columns.append(column.name)
        return columns
1006643
def _columns_for_table(table_name):
    
    return {cname: col
            for (tname, cname), col in _COLUMNS.items()
            if tname == table_name}
161756
def type(self):
        ''''''
        if self.column!=None or self.column_file:
            return "column"
        if self.times!=None or self.times_file:
            return "times"
        return None
1217301
def get_table_columns(metadata):
    
    cols = OrderedDict()
    for col in metadata.c:
        name = str(col).rpartition(".")[2]
        cols[name] = col.type.python_type.__name__
    return cols
909465
def get_cell_format(column_dict, key=None):
    
    format = column_dict.get('format')
    prop = column_dict.get('__col__')

    if format is None and prop is not None:
        if hasattr(prop, 'columns'):
            sqla_column = prop.columns[0]
            column_type = getattr(sqla_column.type, 'impl', sqla_column.type)
            format = FORMAT_REGISTRY.get_item(column_type)
    return format
957564
def indexables(self):
        
        if self._indexables is None:

            self._indexables = []

            # index columns
            self._indexables.extend([
                IndexCol(name=name, axis=axis, pos=i)
                for i, (axis, name) in enumerate(self.attrs.index_cols)
            ])

            # values columns
            dc = set(self.data_columns)
            base_pos = len(self._indexables)

            def f(i, c):
                klass = DataCol
                if c in dc:
                    klass = DataIndexableCol
                return klass.create_for_block(i=i, name=c, pos=base_pos + i,
                                              version=self.version)

            self._indexables.extend(
                [f(i, c) for i, c in enumerate(self.attrs.values_cols)])

        return self._indexables
880071
def list_of_dict(self):
        
        ret = []
        for row in self:
            ret.append(dict([(self._col_names[i], row[i]) for i in
                             range(len(self._col_names))]))
        return ReprListDict(ret, col_names=self._col_names,
                            col_types=self._col_types,
                            width_limit=self._width_limit,
                            digits=self._digits,
                            convert_unicode=self._convert_unicode)
648298
def map_column(self, keys, func):
        
        return [[func(v) for v in self[key]] for key in keys]
756972
def to_dict(self, nested=False):
        
        result = dict()
        for key in self.columns:
            result[key] = getattr(self, key)

        if nested:
            for key in self.relations:
                obj = getattr(self, key)

                if isinstance(obj, SerializeMixin):
                    result[key] = obj.to_dict()
                elif isinstance(obj, Iterable):
                    result[key] = [o.to_dict() for o in obj]

        return result
241309
def specifiedColumns(self):
        
        columns = []
        table = self.tableType()
        tree = self.treePopupWidget()
        schema = table.schema()
        
        if self._specifiedColumns is not None:
            colnames = self._specifiedColumns
        else:
            colnames = tree.columns()
        
        for colname in colnames:
            if isinstance(colname, Column):
                columns.append(colname)
            else:
                col = schema.column(colname)
                if col and not col.isProxy():
                    columns.append(col)
        
        return columns
273682
def show_item_dict(self, item):
        """"""
        d = {}
        for col in self.show_columns:
            v = getattr(item, col)
            if not isinstance(v, (int, float, string_types)):
                v = str(v)
            d[col] = v
        return d
66363
def asDictionary(self):
        
        return {
            "type": "joinTable",
            "leftTableSource": self._leftTableSource,
            "rightTableSource": self._rightTableSource,
            "leftTableKey": self._leftTableKey,
            "rightTableKey": self._rightTableKey,
            "joinType": self._joinType
        }
1051850
def _get_str_columns(sf):
    
    return [name for name in sf.column_names() if sf[name].dtype == str]
1038171
def _col_type_set(self, col, df):
        
        type_set = set()
        if df[col].dtype == np.dtype(object):
            unindexed_col = list(df[col])
            for i in range(0, len(df[col])):
                if unindexed_col[i] == np.nan:
                    continue
                else:
                    type_set.add(type(unindexed_col[i]))
            return type_set
        else:
            type_set.add(df[col].dtype)
            return type_set
1316923
def get_columns(context, query):
        """"""
        table_info = context.sql_client.send(query)
        if 'fields' in table_info:
            return Column.from_sql_api_fields(table_info['fields'])

        return None
1131047
def _parse_columns(self):
    
        '''  '''
        
    # construct column list
        column_map = {}
        for key, value in self.model.keyMap.items():
            record_key = key[1:]
            if record_key:
                if self.item_key.findall(record_key):
                    pass
                else:
                    if value['value_datatype'] == 'map':
                        continue
                    datatype = value['value_datatype']
                    if value['value_datatype'] == 'number':
                        datatype = 'float'
                        if 'integer_data' in value.keys():
                            if value['integer_data']:
                                datatype = 'integer'
                    replace_key = ''
                    if 'field_metadata' in value.keys():
                        if 'replace_key' in value['field_metadata'].keys():
                            if isinstance(value['field_metadata']['replace_key'], str):
                                replace_key = value['field_metadata']['replace_key']
                    max_length = None
                    if 'max_length' in value.keys():
                        max_length = value['max_length']
                    column_map[record_key] = (record_key, datatype, replace_key, max_length)
        
        return column_map