Beispiel #1
0
 def get_value(self, index):
     '''
     get value by index
     :return: Value
     '''
     if index >= self._size:
         raise OutOfRangeException()
     return self._record[index]
Beispiel #2
0
 def get_value(self, index):
     """
     get value by index
     :return: Value
     """
     if index >= len(self._names):
         raise OutOfRangeException()
     return self._record[index]
Beispiel #3
0
 def get_type(self, index):
     '''
     get type by index
     :return: value type
     '''
     if index >= self._size:
         raise OutOfRangeException()
     return self._record[index].getType()
Beispiel #4
0
    def get_value(self, index):
        """get value by specified index

        :param index: the index of column
        :return: ValueWrapper
        """
        if index >= len(self._names):
            raise OutOfRangeException()
        return self._record[index]
Beispiel #5
0
 def row_values(self, row_index):
     """
     Get row values
     :param index: the Record index
     :return: list<ValueWrapper>
     """
     if row_index >= len(self._data_set.rows):
         raise OutOfRangeException()
     return [(ValueWrapper(value)) for value in self._data_set.rows[row_index].values]
Beispiel #6
0
 def row_values(self, index):
     '''
     Get row values
     :param index: the Record index
     :return: Record
     '''
     if index >= self._size:
         raise OutOfRangeException()
     return self._records[index]
Beispiel #7
0
    def row_values(self, row_index):
        """get row values

        :param row_index: the Record index
        :return: list<ValueWrapper>
        """
        if row_index >= len(self._data_set.rows):
            raise OutOfRangeException()
        return [(ValueWrapper(value=value,
                              decode_type=self._decode_type,
                              timezone_offset=self._timezone_offset))
                for value in self._data_set.rows[row_index].values]
Beispiel #8
0
 def get_relationship(self, index):
     '''
     get relationship by key
     :return: Relationship
     '''
     if index >= self._size:
         raise OutOfRangeException()
     if self._record[index] != ttypes.Value.EVAL:
         return InvalidValueTypeException(
             'the type of index: {} is {} != {}'.format(
                 index, self._record[index].getType(), ttypes.Value.EVAL))
     return ConvertValue.convert(self._record[index])
Beispiel #9
0
 def get_path(self, index):
     '''
     get path by index
     :return: Path
     '''
     if index >= self._size:
         raise OutOfRangeException()
     if self._record[index] != ttypes.Value.PVAL:
         return InvalidValueTypeException(
             'the type of index: {} is {} != {}'.format(
                 index, self._record[index].getType(), ttypes.Value.PVAL))
     return ConvertValue.convert(self._record[index])