Row(key: bytes, cells: list[google.cloud.bigtable.data.row.Cell])
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 by family and qualifier to get cells in the row::
cells = row["family", "qualifier"]
Methods
Row
Row(key: bytes, cells: list[google.cloud.bigtable.data.row.Cell])
Row objects are not intended to be created by users. They are returned by the Bigtable backend.
__contains__
__contains__(item)
Implements in
operator
Works for both cells in the internal list, and family
or
(family, qualifier)
pairs associated with the cells
Returns | |
---|---|
Type | Description |
bool |
True if item is in the row, False otherwise |
__eq__
__eq__(other)
Implements ==
operator
Returns | |
---|---|
Type | Description |
bool |
True if rows are equal, False otherwise |
__getitem__
Implements [] indexing
Supports indexing by family, (family, qualifier) pair, numerical index, and index slicing
__iter__
__iter__()
Allow iterating over all cells in the row
Returns | |
---|---|
Type | Description |
Iterator |
Iterator over the cells in the row |
__len__
__len__()
Returns the number of cells in the row
Returns | |
---|---|
Type | Description |
int |
Number of cells in the row |
__ne__
__ne__(other) -> bool
Implements !=
operator
Returns | |
---|---|
Type | Description |
bool |
True if rows are not equal, False otherwise |
__str__
__str__() -> str
Human-readable string representation::
{
(family='fam', qualifier=b'col'): [b'value', (+1 more),],
(family='fam', qualifier=b'col2'): [b'other'],
}
Returns | |
---|---|
Type | Description |
str |
Human-readable string representation of the row |
get_cells
get_cells(
family: typing.Optional[str] = None,
qualifier: typing.Optional[typing.Union[str, bytes]] = None,
) -> list[google.cloud.bigtable.data.row.Cell]
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"]
Exceptions | |
---|---|
Type | Description |
ValueError |
If family or qualifier is not found in the row |
Returns | |
---|---|
Type | Description |
list[Cell] |
List of cells in the row matching the filter |