Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/cloud/bigtable/data/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def __repr__(self):
return f"{self.__class__.__name__}({message!r}, {self.exceptions!r})"


# TODO: When working on mutations batcher, rework exception handling to guarantee that
# MutationsExceptionGroup only stores FailedMutationEntryErrors.
class MutationsExceptionGroup(_BigtableExceptionGroup):
"""
Represents one or more exceptions that occur during a bulk mutation operation
Expand Down
18 changes: 12 additions & 6 deletions google/cloud/bigtable/row.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,17 @@ def _set_cell(self, column_family_id, column, value, timestamp=None, state=None)
integer (8 bytes).

:type timestamp: :class:`datetime.datetime`
:param timestamp: (Optional) The timestamp of the operation.
:param timestamp: (Optional) The timestamp of the operation. If a
timestamp is not provided, the current system time
will be used.

:type state: bool
:param state: (Optional) The state that is passed along to
:meth:`_get_mutations`.
"""
if timestamp is None:
# Use current Bigtable server time.
timestamp_micros = mutations._SERVER_SIDE_TIMESTAMP
if timestamp is None or timestamp == mutations._SERVER_SIDE_TIMESTAMP:
# Preserve special-case values (client side timestamp generation or server side timestamp)
timestamp_micros = timestamp
else:
timestamp_micros = _microseconds_from_datetime(timestamp)
# Truncate to millisecond granularity.
Expand Down Expand Up @@ -351,7 +353,9 @@ def set_cell(self, column_family_id, column, value, timestamp=None):
integer (8 bytes).

:type timestamp: :class:`datetime.datetime`
:param timestamp: (Optional) The timestamp of the operation.
:param timestamp: (Optional) The timestamp of the operation. If a
timestamp is not provided, the current system time
will be used.
"""
self._set_cell(column_family_id, column, value, timestamp=timestamp, state=None)

Expand Down Expand Up @@ -651,7 +655,9 @@ def set_cell(self, column_family_id, column, value, timestamp=None, state=True):
integer (8 bytes).

:type timestamp: :class:`datetime.datetime`
:param timestamp: (Optional) The timestamp of the operation.
:param timestamp: (Optional) The timestamp of the operation. If a
timestamp is not provided, the current system time
will be used.

:type state: bool
:param state: (Optional) The state that the mutation should be
Expand Down
Loading
Loading