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
Name | Description |
row_key |
bytes
The key for the row holding the (partial) data. |
Inheritance
builtins.object > PartialRowDataProperties
cells
Property returning all the cells accumulated on this partial row.
For example:
.. literalinclude:: snippets_table.py :start-after: [START bigtable_api_row_data_cells] :end-before: [END bigtable_api_row_data_cells] :dedent: 4
Type | Description |
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.
Type | Description |
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_api_row_cell_value] :end-before: [END bigtable_api_row_cell_value] :dedent: 4
Name | Description |
column_family_id |
str
The ID of the column family. Must be of the form |
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. |
Type | Description |
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. |
Type | Description |
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_api_row_cell_values] :end-before: [END bigtable_api_row_cell_values] :dedent: 4
Name | Description |
column_family_id |
str
The ID of the column family. Must be of the form |
column |
bytes
The column within the column family where the cells are located. |
max_count |
int
The maximum number of cells to use. |
Type | Description |
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``. |
Type | Description |
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_api_row_find_cells] :end-before: [END bigtable_api_row_find_cells] :dedent: 4
Name | Description |
column_family_id |
str
The ID of the column family. Must be of the form |
column |
bytes
The column within the column family where the cells are located. |
Type | Description |
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``. |
Type | Description |
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 :
).
Type | Description |
dict | Dictionary containing all the data in the cells of this row. |