Module row (2.14.0)

Stay organized with collections Save and categorize content based on your preferences.

User-friendly container for Google Cloud Bigtable Row.

Classes

AppendRow

AppendRow(row_key, table)

Google Cloud Bigtable Row for sending append mutations.

These mutations are intended to augment the value of an existing cell and uses the methods:

  • append_cell_value
  • increment_cell_value

The first works by appending bytes and the second by incrementing an integer (stored in the cell as 8 bytes). In either case, if the cell is empty, assumes the default empty value (empty string for bytes or 0 for integer).

Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

The table that owns the row.

Cell

Cell(value, timestamp_micros, labels=None)

Representation of a Google Cloud Bigtable Cell.

Parameters
NameDescription
value bytes

The value stored in the cell.

timestamp_micros int

The timestamp_micros when the cell was stored.

labels list

(Optional) List of strings. Labels applied to the cell.

ConditionalRow

ConditionalRow(row_key, table, filter_)

Google Cloud Bigtable Row for sending mutations conditionally.

Each mutation has an associated state: :data:True or :data:False. When commit-ed, the mutations for the :data:True state will be applied if the filter matches any cells in the row, otherwise the :data:False state will be applied.

A ConditionalRow accumulates mutations in the same way a DirectRow does:

  • set_cell
  • delete
  • delete_cell
  • delete_cells

with the only change the extra state parameter::

row_cond = table.row(b'row-key2', filter_=row_filter) row_cond.set_cell(u'fam', b'col', b'cell-val', state=True) row_cond.delete_cell(u'fam', b'col', state=False)

Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

The table that owns the row.

filter_ .RowFilter

Filter to be used for conditional mutations.

DirectRow

DirectRow(row_key, table=None)

Google Cloud Bigtable Row for sending "direct" mutations.

These mutations directly set or delete cell contents:

  • set_cell
  • delete
  • delete_cell
  • delete_cells

These methods can be used directly::

row = table.row(b'row-key1') row.set_cell(u'fam', b'col1', b'cell-val') row.delete_cell(u'fam', b'col2')

Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

(Optional) The table that owns the row. This is used for the :meth: commit only. Alternatively, DirectRows can be persisted via mutate_rows.

InvalidChunk

Exception raised to invalid chunk data from back-end.

PartialRowData

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
NameDescription
row_key bytes

The key for the row holding the (partial) data.

Row

Row(row_key, table=None)

Base representation of a Google Cloud Bigtable Row.

This class has three subclasses corresponding to the three RPC methods for sending row mutations:

  • DirectRow for MutateRow
  • ConditionalRow for CheckAndMutateRow
  • AppendRow for ReadModifyWriteRow
Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

(Optional) The table that owns the row.