Skip to content

Commit dfed785

Browse files
authored
1 parent b597303 commit dfed785

4 files changed

Lines changed: 40 additions & 1 deletion

File tree

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/types/table.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,14 @@ class TimestampGranularity(proto.Enum):
246246
MILLIS (1):
247247
The table keeps data versioned at a
248248
granularity of 1ms.
249+
MICROS (2):
250+
The table keeps data versioned at a
251+
granularity of 1us.
249252
"""
250253

251254
TIMESTAMP_GRANULARITY_UNSPECIFIED = 0
252255
MILLIS = 1
256+
MICROS = 2
253257

254258
class View(proto.Enum):
255259
r"""Defines a view over a table's fields.

packages/google-cloud-bigtable/google/cloud/bigtable_v2/types/data.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,8 +1082,36 @@ class Mutation(proto.Message):
10821082
Deletes cells from the entire row.
10831083
10841084
This field is a member of `oneof`_ ``mutation``.
1085+
timestamp_origin (google.cloud.bigtable_v2.types.Mutation.TimestampOrigin):
1086+
Optional. The origin of the timestamp in this
1087+
mutation.
10851088
"""
10861089

1090+
class TimestampOrigin(proto.Enum):
1091+
r"""Represents the origin of the timestamp in the mutation.
1092+
1093+
Values:
1094+
TIMESTAMP_ORIGIN_UNSPECIFIED (0):
1095+
Default value. Should not be explicitly set.
1096+
USER_SPECIFIED (1):
1097+
Indicates that the timestamp was explicitly provided by the
1098+
user (either ``>0`` or ``-1`` for server-assigned). The
1099+
server will reject the mutation if the timestamp's precision
1100+
does not match the table's granularity. (e.g., a millisecond
1101+
table only allows timestamps that are multiples of 1000).
1102+
CLIENT_AUTO_GENERATED (2):
1103+
Indicates that the timestamp was
1104+
auto-generated by the client library. The server
1105+
will truncate the timestamp's precision to match
1106+
the table's granularity.
1107+
(e.g., zeroing the last 3 digits for a
1108+
millisecond table).
1109+
"""
1110+
1111+
TIMESTAMP_ORIGIN_UNSPECIFIED = 0
1112+
USER_SPECIFIED = 1
1113+
CLIENT_AUTO_GENERATED = 2
1114+
10871115
class SetCell(proto.Message):
10881116
r"""A Mutation which sets the value of the specified cell.
10891117
@@ -1295,6 +1323,11 @@ class DeleteFromRow(proto.Message):
12951323
oneof="mutation",
12961324
message=DeleteFromRow,
12971325
)
1326+
timestamp_origin: TimestampOrigin = proto.Field(
1327+
proto.ENUM,
1328+
number=7,
1329+
enum=TimestampOrigin,
1330+
)
12981331

12991332

13001333
class ReadModifyWriteRule(proto.Message):

packages/google-cloud-storage/tests/resumable_media/unit/requests/test_upload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
import tempfile
1919
from unittest import mock
2020

21-
import google.cloud.storage._media.requests.upload as upload_mod
2221
import pytest # type: ignore
2322

23+
import google.cloud.storage._media.requests.upload as upload_mod
24+
2425
URL_PREFIX = "https://www.googleapis.com/upload/storage/v1/b/{BUCKET}/o"
2526
SIMPLE_URL = URL_PREFIX + "?uploadType=media&name={OBJECT}"
2627
MULTIPART_URL = URL_PREFIX + "?uploadType=multipart"

packages/google-cloud-storage/tests/system/test_blob.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import mock
2424
import pytest
2525
from google.api_core import exceptions
26+
2627
from google.cloud.storage._helpers import _base64_md5hash
2728
from google.cloud.storage.exceptions import DataCorruption
2829

0 commit comments

Comments
 (0)