Rows and Cells
class google.cloud.bigtable.data.row.Cell(value: bytes , row_key: bytes , family: str , qualifier: bytes | str , timestamp_micros: int , labels: Optional [ list [ str ]] = None)
Bases: object
Model class for cell data
Does not represent all data contained in the cell, only data returned by a query. Expected to be read-only to users, and written by backend
Cell constructor
Cell objects are not intended to be constructed by users. They are returned by the Bigtable backend.
_ eq_ (other)
Implements == operator
_ hash_ ()
Implements hash() function to fingerprint cell
_ int_ ()
Allows casting cell to int Interprets value as a 64-bit big-endian signed integer, as expected by ReadModifyWrite increment rule
_ lt_ (other)
Implements < operator
_ ne_ (other)
Implements != operator
_ repr_ ()
Returns a string representation of the cell
_ str_ ()
Allows casting cell to str Prints encoded byte string, same as printing value directly.
class google.cloud.bigtable.data.row.Row(key: bytes , cells: list [google.cloud.bigtable.data.row.Cell])
Bases: object
Model class for row data returned from server
Does not represent all data contained in the row, only data returned by a query. Expected to be read-only to users, and written by backend
Can be indexed: cells = row[“family”, “qualifier”]
Initializes a Row object
Row objects are not intended to be created by users. They are returned by the Bigtable backend.
_ contains_ (item)
Implements in operator
Works for both cells in the internal list, and family or (family, qualifier) pairs associated with the cells
_ eq_ (other)
Implements == operator
_ getitem_ (index: str | tuple [ str , bytes | str ])
_ getitem_ (index: int )
_ getitem_ (index: slice )
Implements [] indexing
Supports indexing by family, (family, qualifier) pair, numerical index, and index slicing
_ iter_ ()
Allow iterating over all cells in the row
_ len_ ()
Implements len() operator
_ ne_ (other)
Implements != operator
_ str_ ()
Human-readable string representation
{
(family='fam', qualifier=b'col'): [b'value', (+1 more),],
(family='fam', qualifier=b'col2'): [b'other'],
}
get_cells(family: Optional [ str ] = None, qualifier: Optional [ Union [ str , bytes ]] = None)
Returns cells sorted in Bigtable native order:
* Family lexicographically ascending
* Qualifier ascending
* Timestamp in reverse chronological order
If family or qualifier not passed, will include all
Can also be accessed through indexing:
cells = row[“family”, “qualifier”]
cells = row[“family”]