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 May 23, 2024
1 parent dce8474 commit 4954998
Show file tree
Hide file tree
Showing 113 changed files with 115 additions and 86,762 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,7 @@ def __call__(
# Jsonify the request body

body = json_format.MessageToJson(
transcoded_request["body"],
use_integers_for_enums=True,
transcoded_request["body"], use_integers_for_enums=True
)
uri = transcoded_request["uri"]
method = transcoded_request["method"]
Expand Down
66 changes: 62 additions & 4 deletions google/cloud/bigtable_admin_v2/types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ class Type(proto.Message):
original typed value? Note that Bigtable will always sort data
based on the raw encoded value, *not* the decoded type.
- Example: STRING values sort in the same order as their UTF-8
- Example: BYTES values sort in the same order as their raw
encodings.
- Counterexample: Encoding INT64 to a fixed-width STRING does
*not* preserve sort order when dealing with negative numbers.
INT64(1) > INT64(-1), but STRING("-00001") > STRING("00001).
- The overall encoding chain sorts naturally if *every* link
- The overall encoding chain has this property if *every* link
does.
- Self-delimiting: If we concatenate two encoded values, can we
Expand All @@ -65,8 +65,8 @@ class Type(proto.Message):
by a sign.
- Counterexample: If we concatenate two UTF-8 encoded STRINGs,
we have no way to tell where the first one ends.
- The overall encoding chain is self-delimiting if *any* link
is.
- The overall encoding chain has this property if *any* link
does.
- Compatibility: Which other systems have matching encoding
schemes? For example, does this encoding have a GoogleSQL
Expand All @@ -83,6 +83,10 @@ class Type(proto.Message):
bytes_type (google.cloud.bigtable_admin_v2.types.Type.Bytes):
Bytes
This field is a member of `oneof`_ ``kind``.
string_type (google.cloud.bigtable_admin_v2.types.Type.String):
String
This field is a member of `oneof`_ ``kind``.
int64_type (google.cloud.bigtable_admin_v2.types.Type.Int64):
Int64
Expand Down Expand Up @@ -137,6 +141,54 @@ class Raw(proto.Message):
message="Type.Bytes.Encoding",
)

class String(proto.Message):
r"""String Values of type ``String`` are stored in
``Value.string_value``.
Attributes:
encoding (google.cloud.bigtable_admin_v2.types.Type.String.Encoding):
The encoding to use when converting to/from
lower level types.
"""

class Encoding(proto.Message):
r"""Rules used to convert to/from lower level types.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
utf8_raw (google.cloud.bigtable_admin_v2.types.Type.String.Encoding.Utf8Raw):
Use ``Utf8Raw`` encoding.
This field is a member of `oneof`_ ``encoding``.
"""

class Utf8Raw(proto.Message):
r"""UTF-8 encoding
- Natural sort? No (ASCII characters only)
- Self-delimiting? No
- Compatibility?
- BigQuery Federation ``TEXT`` encoding
- HBase ``Bytes.toBytes``
- Java ``String#getBytes(StandardCharsets.UTF_8)``
"""

utf8_raw: "Type.String.Encoding.Utf8Raw" = proto.Field(
proto.MESSAGE,
number=1,
oneof="encoding",
message="Type.String.Encoding.Utf8Raw",
)

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

class Int64(proto.Message):
r"""Int64 Values of type ``Int64`` are stored in ``Value.int_value``.
Expand Down Expand Up @@ -250,6 +302,12 @@ class Sum(proto.Message):
oneof="kind",
message=Bytes,
)
string_type: String = proto.Field(
proto.MESSAGE,
number=2,
oneof="kind",
message=String,
)
int64_type: Int64 = proto.Field(
proto.MESSAGE,
number=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@
_transport_registry = OrderedDict() # type: Dict[str, Type[BigtableTransport]]
_transport_registry["grpc"] = BigtableGrpcTransport
_transport_registry["grpc_asyncio"] = BigtableGrpcAsyncIOTransport
_transport_registry["pooled_grpc_asyncio"] = PooledBigtableGrpcAsyncIOTransport
_transport_registry["rest"] = BigtableRestTransport

__all__ = (
"BigtableTransport",
"BigtableGrpcTransport",
"BigtableGrpcAsyncIOTransport",
"PooledBigtableGrpcAsyncIOTransport",
"BigtableRestTransport",
"BigtableRestInterceptor",
)
13 changes: 0 additions & 13 deletions owl-bot-staging/bigtable/v2/.coveragerc

This file was deleted.

33 changes: 0 additions & 33 deletions owl-bot-staging/bigtable/v2/.flake8

This file was deleted.

2 changes: 0 additions & 2 deletions owl-bot-staging/bigtable/v2/MANIFEST.in

This file was deleted.

49 changes: 0 additions & 49 deletions owl-bot-staging/bigtable/v2/README.rst

This file was deleted.

3 changes: 0 additions & 3 deletions owl-bot-staging/bigtable/v2/docs/_static/custom.css

This file was deleted.

6 changes: 0 additions & 6 deletions owl-bot-staging/bigtable/v2/docs/bigtable_v2/bigtable.rst

This file was deleted.

6 changes: 0 additions & 6 deletions owl-bot-staging/bigtable/v2/docs/bigtable_v2/services_.rst

This file was deleted.

6 changes: 0 additions & 6 deletions owl-bot-staging/bigtable/v2/docs/bigtable_v2/types_.rst

This file was deleted.

Loading

0 comments on commit 4954998

Please sign in to comment.