Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Mar 8, 2024
1 parent b8f0d77 commit 663f35e
Show file tree
Hide file tree
Showing 116 changed files with 168 additions and 76,172 deletions.
2 changes: 2 additions & 0 deletions google/cloud/bigtable_admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
from google.cloud.bigtable_admin_v2.types.table import Snapshot
from google.cloud.bigtable_admin_v2.types.table import Table
from google.cloud.bigtable_admin_v2.types.table import RestoreSourceType
from google.cloud.bigtable_admin_v2.types.types import Type

__all__ = (
"BigtableInstanceAdminClient",
Expand Down Expand Up @@ -329,4 +330,5 @@
"Snapshot",
"Table",
"RestoreSourceType",
"Type",
)
2 changes: 2 additions & 0 deletions google/cloud/bigtable_admin_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
from .types.table import Snapshot
from .types.table import Table
from .types.table import RestoreSourceType
from .types.types import Type

__all__ = (
"BigtableInstanceAdminAsyncClient",
Expand Down Expand Up @@ -194,6 +195,7 @@
"SnapshotTableRequest",
"StorageType",
"Table",
"Type",
"UndeleteTableMetadata",
"UndeleteTableRequest",
"UpdateAppProfileMetadata",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/bigtable_admin_v2/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
Table,
RestoreSourceType,
)
from .types import (
Type,
)

__all__ = (
"CreateAppProfileRequest",
Expand Down Expand Up @@ -201,4 +204,5 @@
"Snapshot",
"Table",
"RestoreSourceType",
"Type",
)
10 changes: 10 additions & 0 deletions google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ class Modification(proto.Message):
given ID, or fail if no such family exists.
This field is a member of `oneof`_ ``mod``.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Optional. A mask specifying which fields (e.g. ``gc_rule``)
in the ``update`` mod should be updated, ignored for other
modification types. If unset or empty, we treat it as
updating ``gc_rule`` to be backward compatible.
"""

id: str = proto.Field(
Expand All @@ -663,6 +668,11 @@ class Modification(proto.Message):
number=4,
oneof="mod",
)
update_mask: field_mask_pb2.FieldMask = proto.Field(
proto.MESSAGE,
number=6,
message=field_mask_pb2.FieldMask,
)

name: str = proto.Field(
proto.STRING,
Expand Down
20 changes: 20 additions & 0 deletions google/cloud/bigtable_admin_v2/types/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import proto # type: ignore

from google.cloud.bigtable_admin_v2.types import types
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from google.rpc import status_pb2 # type: ignore
Expand Down Expand Up @@ -442,13 +443,32 @@ class ColumnFamily(proto.Message):
opportunistically in the background, and so it's
possible for reads to return a cell even if it
matches the active GC expression for its family.
value_type (google.cloud.bigtable_admin_v2.types.Type):
The type of data stored in each of this family's cell
values, including its full encoding. If omitted, the family
only serves raw untyped bytes.
For now, only the ``Aggregate`` type is supported.
``Aggregate`` can only be set at family creation and is
immutable afterwards.
If ``value_type`` is ``Aggregate``, written data must be
compatible with:
- ``value_type.input_type`` for ``AddInput`` mutations
"""

gc_rule: "GcRule" = proto.Field(
proto.MESSAGE,
number=1,
message="GcRule",
)
value_type: types.Type = proto.Field(
proto.MESSAGE,
number=3,
message=types.Type,
)


class GcRule(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@


__protobuf__ = proto.module(
package='google.bigtable.admin.v2',
package="google.bigtable.admin.v2",
manifest={
'Type',
"Type",
},
)

Expand Down Expand Up @@ -124,17 +124,17 @@ class Raw(proto.Message):
"""

raw: 'Type.Bytes.Encoding.Raw' = proto.Field(
raw: "Type.Bytes.Encoding.Raw" = proto.Field(
proto.MESSAGE,
number=1,
oneof='encoding',
message='Type.Bytes.Encoding.Raw',
oneof="encoding",
message="Type.Bytes.Encoding.Raw",
)

encoding: 'Type.Bytes.Encoding' = proto.Field(
encoding: "Type.Bytes.Encoding" = proto.Field(
proto.MESSAGE,
number=1,
message='Type.Bytes.Encoding',
message="Type.Bytes.Encoding",
)

class Int64(proto.Message):
Expand Down Expand Up @@ -176,23 +176,23 @@ class BigEndianBytes(proto.Message):
further.
"""

bytes_type: 'Type.Bytes' = proto.Field(
bytes_type: "Type.Bytes" = proto.Field(
proto.MESSAGE,
number=1,
message='Type.Bytes',
message="Type.Bytes",
)

big_endian_bytes: 'Type.Int64.Encoding.BigEndianBytes' = proto.Field(
big_endian_bytes: "Type.Int64.Encoding.BigEndianBytes" = proto.Field(
proto.MESSAGE,
number=1,
oneof='encoding',
message='Type.Int64.Encoding.BigEndianBytes',
oneof="encoding",
message="Type.Int64.Encoding.BigEndianBytes",
)

encoding: 'Type.Int64.Encoding' = proto.Field(
encoding: "Type.Int64.Encoding" = proto.Field(
proto.MESSAGE,
number=1,
message='Type.Int64.Encoding',
message="Type.Int64.Encoding",
)

class Aggregate(proto.Message):
Expand Down Expand Up @@ -227,39 +227,39 @@ class Sum(proto.Message):
"""

input_type: 'Type' = proto.Field(
input_type: "Type" = proto.Field(
proto.MESSAGE,
number=1,
message='Type',
message="Type",
)
state_type: 'Type' = proto.Field(
state_type: "Type" = proto.Field(
proto.MESSAGE,
number=2,
message='Type',
message="Type",
)
sum: 'Type.Aggregate.Sum' = proto.Field(
sum: "Type.Aggregate.Sum" = proto.Field(
proto.MESSAGE,
number=4,
oneof='aggregator',
message='Type.Aggregate.Sum',
oneof="aggregator",
message="Type.Aggregate.Sum",
)

bytes_type: Bytes = proto.Field(
proto.MESSAGE,
number=1,
oneof='kind',
oneof="kind",
message=Bytes,
)
int64_type: Int64 = proto.Field(
proto.MESSAGE,
number=5,
oneof='kind',
oneof="kind",
message=Int64,
)
aggregate_type: Aggregate = proto.Field(
proto.MESSAGE,
number=6,
oneof='kind',
oneof="kind",
message=Aggregate,
)

Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigtable_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
from .types.data import StreamContinuationTokens
from .types.data import StreamPartition
from .types.data import TimestampRange
from .types.data import Value
from .types.data import ValueRange
from .types.feature_flags import FeatureFlags
from .types.request_stats import FullReadStatsView
Expand Down Expand Up @@ -104,5 +105,6 @@
"StreamContinuationTokens",
"StreamPartition",
"TimestampRange",
"Value",
"ValueRange",
)
2 changes: 2 additions & 0 deletions google/cloud/bigtable_v2/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
StreamContinuationTokens,
StreamPartition,
TimestampRange,
Value,
ValueRange,
)
from .feature_flags import (
Expand Down Expand Up @@ -98,6 +99,7 @@
"StreamContinuationTokens",
"StreamPartition",
"TimestampRange",
"Value",
"ValueRange",
"FeatureFlags",
"FullReadStatsView",
Expand Down
101 changes: 101 additions & 0 deletions google/cloud/bigtable_v2/types/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Family",
"Column",
"Cell",
"Value",
"RowRange",
"RowSet",
"ColumnRange",
Expand Down Expand Up @@ -164,6 +165,54 @@ class Cell(proto.Message):
)


class Value(proto.Message):
r"""``Value`` represents a dynamically typed value. The typed fields in
``Value`` are used as a transport encoding for the actual value
(which may be of a more complex type). See the documentation of the
``Type`` message for more details.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
raw_value (bytes):
Represents a raw byte sequence with no type information. The
``type`` field must be omitted.
This field is a member of `oneof`_ ``kind``.
raw_timestamp_micros (int):
Represents a raw cell timestamp with no type information.
The ``type`` field must be omitted.
This field is a member of `oneof`_ ``kind``.
int_value (int):
Represents a typed value transported as an integer. Default
type for writes: ``Int64``
This field is a member of `oneof`_ ``kind``.
"""

raw_value: bytes = proto.Field(
proto.BYTES,
number=8,
oneof="kind",
)
raw_timestamp_micros: int = proto.Field(
proto.INT64,
number=9,
oneof="kind",
)
int_value: int = proto.Field(
proto.INT64,
number=6,
oneof="kind",
)


class RowRange(proto.Message):
r"""Specifies a contiguous range of rows.
Expand Down Expand Up @@ -853,6 +902,10 @@ class Mutation(proto.Message):
set_cell (google.cloud.bigtable_v2.types.Mutation.SetCell):
Set a cell's value.
This field is a member of `oneof`_ ``mutation``.
add_to_cell (google.cloud.bigtable_v2.types.Mutation.AddToCell):
Incrementally updates an ``Aggregate`` cell.
This field is a member of `oneof`_ ``mutation``.
delete_from_column (google.cloud.bigtable_v2.types.Mutation.DeleteFromColumn):
Deletes cells from a column.
Expand Down Expand Up @@ -909,6 +962,48 @@ class SetCell(proto.Message):
number=4,
)

class AddToCell(proto.Message):
r"""A Mutation which incrementally updates a cell in an ``Aggregate``
family.
Attributes:
family_name (str):
The name of the ``Aggregate`` family into which new data
should be added. This must be a family with a ``value_type``
of ``Aggregate``. Format: ``[-_.a-zA-Z0-9]+``
column_qualifier (google.cloud.bigtable_v2.types.Value):
The qualifier of the column into which new data should be
added. This must be a ``raw_value``.
timestamp (google.cloud.bigtable_v2.types.Value):
The timestamp of the cell to which new data should be added.
This must be a ``raw_timestamp_micros`` that matches the
table's ``granularity``.
input (google.cloud.bigtable_v2.types.Value):
The input value to be accumulated into the specified cell.
This must be compatible with the family's
``value_type.input_type``.
"""

family_name: str = proto.Field(
proto.STRING,
number=1,
)
column_qualifier: "Value" = proto.Field(
proto.MESSAGE,
number=2,
message="Value",
)
timestamp: "Value" = proto.Field(
proto.MESSAGE,
number=3,
message="Value",
)
input: "Value" = proto.Field(
proto.MESSAGE,
number=4,
message="Value",
)

class DeleteFromColumn(proto.Message):
r"""A Mutation which deletes cells from the specified column,
optionally restricting the deletions to a given timestamp range.
Expand Down Expand Up @@ -964,6 +1059,12 @@ class DeleteFromRow(proto.Message):
oneof="mutation",
message=SetCell,
)
add_to_cell: AddToCell = proto.Field(
proto.MESSAGE,
number=5,
oneof="mutation",
message=AddToCell,
)
delete_from_column: DeleteFromColumn = proto.Field(
proto.MESSAGE,
number=2,
Expand Down
Loading

0 comments on commit 663f35e

Please sign in to comment.