Class PartialRowData (1.3.0)
Stay organized with collections
Save and categorize content based on your preferences.
PartialRowData(row_key)Representation of partial row in a Google Cloud Bigtable Table.
These are expected to be updated directly from a
._generated.bigtable_service_messages_pb2.ReadRowsResponse
Parameter
row_key
bytes
The key for the row holding the (partial) data.
Properties
cells
Property returning all the cells accumulated on this partial row.
For example:
.. literalinclude:: snippets_table.py :start-after: [START bigtable_row_data_cells] :end-before: [END bigtable_row_data_cells]
dict
Dictionary of the Cell objects accumulated. This dictionary has two-levels of keys (first for column families and second for column names/qualifiers within a family). For a given column, a list of Cell objects is stored.
row_key
Getter for the current (partial) row's key.
bytes
The current (partial) row's key.
Methods
cell_value
cell_value(column_family_id, column, index=0)Get a single cell value stored on this instance.
For example:
.. literalinclude:: snippets_table.py :start-after: [START bigtable_row_cell_value] :end-before: [END bigtable_row_cell_value]
column_family_id
str
The ID of the column family. Must be of the form <code>_a-zA-Z0-9][-_.a-zA-Z0-9]</code>*.
column
bytes
The column within the column family where the cell is located.
index
Optional[int]
The offset within the series of values. If not specified, will return the first cell.
KeyError
If column_family_id is not among the cells stored in this row.
KeyError
If column is not among the cells stored in this row for the given column_family_id.
IndexError
If index cannot be found within the cells stored in this row for the given column_family_id, column pair.
Cell value
The cell value stored in the specified column and specified index.
cell_values
cell_values(column_family_id, column, max_count=None)Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py :start-after: [START bigtable_row_cell_values] :end-before: [END bigtable_row_cell_values]
column_family_id
str
The ID of the column family. Must be of the form <code>_a-zA-Z0-9][-_.a-zA-Z0-9]</code>*.
column
bytes
The column within the column family where the cells are located.
max_count
int
The maximum number of cells to use.
KeyError
If column_family_id is not among the cells stored in this row.
KeyError
If column is not among the cells stored in this row for the given column_family_id.
A generator which provides
cell.value, cell.timestamp_micros for each cell in the list of cells
find_cells
find_cells(column_family_id, column)Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py :start-after: [START bigtable_row_find_cells] :end-before: [END bigtable_row_find_cells]
column_family_id
str
The ID of the column family. Must be of the form <code>_a-zA-Z0-9][-_.a-zA-Z0-9]</code>*.
column
bytes
The column within the column family where the cells are located.
KeyError
If column_family_id is not among the cells stored in this row.
KeyError
If column is not among the cells stored in this row for the given column_family_id.
List[Cell]
The cells stored in the specified column.
to_dict
to_dict()Convert the cells to a dictionary.
This is intended to be used with HappyBase, so the column family and
column qualiers are combined (with :).
dict
Dictionary containing all the data in the cells of this row.