Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit ec04714

Browse files
docs: Add documentation for enums (#553)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: googleapis/googleapis-gen@0080f83 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * workaround docs issue Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 5635fe5 commit ec04714

15 files changed

Lines changed: 281 additions & 20 deletions

File tree

bigquery-storage-v1-py.tar.gz

64 KB
Binary file not shown.

google/cloud/bigquery_storage_v1/services/big_query_read/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ def sample_split_read_stream():
856856
# Done; return the response.
857857
return response
858858

859-
def __enter__(self):
859+
def __enter__(self) -> "BigQueryReadClient":
860860
return self
861861

862862
def __exit__(self, type, value, traceback):

google/cloud/bigquery_storage_v1/services/big_query_write/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ def sample_flush_rows():
11321132
# Done; return the response.
11331133
return response
11341134

1135-
def __enter__(self):
1135+
def __enter__(self) -> "BigQueryWriteClient":
11361136
return self
11371137

11381138
def __exit__(self, type, value, traceback):

google/cloud/bigquery_storage_v1/types/arrow.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ class ArrowSerializationOptions(proto.Message):
7878
"""
7979

8080
class CompressionCodec(proto.Enum):
81-
r"""Compression codec's supported by Arrow."""
81+
r"""Compression codec's supported by Arrow.
82+
83+
Values:
84+
COMPRESSION_UNSPECIFIED (0):
85+
If unspecified no compression will be used.
86+
LZ4_FRAME (1):
87+
LZ4 Frame
88+
(https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md)
89+
ZSTD (2):
90+
Zstandard compression.
91+
"""
8292
COMPRESSION_UNSPECIFIED = 0
8393
LZ4_FRAME = 1
8494
ZSTD = 2

google/cloud/bigquery_storage_v1/types/storage.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,17 @@ class MissingValueInterpretation(proto.Enum):
422422
values are fields present in user schema but missing in rows. A
423423
missing value can represent a NULL or a column default value
424424
defined in BigQuery table schema.
425+
426+
Values:
427+
MISSING_VALUE_INTERPRETATION_UNSPECIFIED (0):
428+
Invalid missing value interpretation.
429+
Requests with this value will be rejected.
430+
NULL_VALUE (1):
431+
Missing value is interpreted as NULL.
432+
DEFAULT_VALUE (2):
433+
Missing value is interpreted as column
434+
default value if declared in the table schema,
435+
NULL otherwise.
425436
"""
426437
MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0
427438
NULL_VALUE = 1
@@ -748,7 +759,36 @@ class StorageError(proto.Message):
748759
"""
749760

750761
class StorageErrorCode(proto.Enum):
751-
r"""Error code for ``StorageError``."""
762+
r"""Error code for ``StorageError``.
763+
764+
Values:
765+
STORAGE_ERROR_CODE_UNSPECIFIED (0):
766+
Default error.
767+
TABLE_NOT_FOUND (1):
768+
Table is not found in the system.
769+
STREAM_ALREADY_COMMITTED (2):
770+
Stream is already committed.
771+
STREAM_NOT_FOUND (3):
772+
Stream is not found.
773+
INVALID_STREAM_TYPE (4):
774+
Invalid Stream type.
775+
For example, you try to commit a stream that is
776+
not pending.
777+
INVALID_STREAM_STATE (5):
778+
Invalid Stream state.
779+
For example, you try to commit a stream that is
780+
not finalized or is garbaged.
781+
STREAM_FINALIZED (6):
782+
Stream is finalized.
783+
SCHEMA_MISMATCH_EXTRA_FIELDS (7):
784+
There is a schema mismatch and it is caused
785+
by user schema has extra field than bigquery
786+
schema.
787+
OFFSET_ALREADY_EXISTS (8):
788+
Offset already exists.
789+
OFFSET_OUT_OF_RANGE (9):
790+
Offset out of range.
791+
"""
752792
STORAGE_ERROR_CODE_UNSPECIFIED = 0
753793
TABLE_NOT_FOUND = 1
754794
STREAM_ALREADY_COMMITTED = 2
@@ -789,7 +829,14 @@ class RowError(proto.Message):
789829
"""
790830

791831
class RowErrorCode(proto.Enum):
792-
r"""Error code for ``RowError``."""
832+
r"""Error code for ``RowError``.
833+
834+
Values:
835+
ROW_ERROR_CODE_UNSPECIFIED (0):
836+
Default error.
837+
FIELDS_ERROR (1):
838+
One or more fields in the row has errors.
839+
"""
793840
ROW_ERROR_CODE_UNSPECIFIED = 0
794841
FIELDS_ERROR = 1
795842

google/cloud/bigquery_storage_v1/types/stream.py

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,20 @@
3636

3737

3838
class DataFormat(proto.Enum):
39-
r"""Data format for input or output data."""
39+
r"""Data format for input or output data.
40+
41+
Values:
42+
DATA_FORMAT_UNSPECIFIED (0):
43+
Data format is unspecified.
44+
AVRO (1):
45+
Avro is a standard open source row based file
46+
format. See https://avro.apache.org/ for more
47+
details.
48+
ARROW (2):
49+
Arrow is a standard open source column-based
50+
message format. See https://arrow.apache.org/
51+
for more details.
52+
"""
4053
DATA_FORMAT_UNSPECIFIED = 0
4154
AVRO = 1
4255
ARROW = 2
@@ -45,6 +58,20 @@ class DataFormat(proto.Enum):
4558
class WriteStreamView(proto.Enum):
4659
r"""WriteStreamView is a view enum that controls what details
4760
about a write stream should be returned.
61+
62+
Values:
63+
WRITE_STREAM_VIEW_UNSPECIFIED (0):
64+
The default / unset value.
65+
BASIC (1):
66+
The BASIC projection returns basic metadata
67+
about a write stream. The basic view does not
68+
include schema information. This is the default
69+
view returned by GetWriteStream.
70+
FULL (2):
71+
The FULL projection returns all available
72+
write stream metadata, including the schema.
73+
CreateWriteStream returns the full projection of
74+
write stream metadata.
4875
"""
4976
WRITE_STREAM_VIEW_UNSPECIFIED = 0
5077
BASIC = 1
@@ -334,14 +361,37 @@ class WriteStream(proto.Message):
334361
"""
335362

336363
class Type(proto.Enum):
337-
r"""Type enum of the stream."""
364+
r"""Type enum of the stream.
365+
366+
Values:
367+
TYPE_UNSPECIFIED (0):
368+
Unknown type.
369+
COMMITTED (1):
370+
Data will commit automatically and appear as
371+
soon as the write is acknowledged.
372+
PENDING (2):
373+
Data is invisible until the stream is
374+
committed.
375+
BUFFERED (3):
376+
Data is only visible up to the offset to
377+
which it was flushed.
378+
"""
338379
TYPE_UNSPECIFIED = 0
339380
COMMITTED = 1
340381
PENDING = 2
341382
BUFFERED = 3
342383

343384
class WriteMode(proto.Enum):
344-
r"""Mode enum of the stream."""
385+
r"""Mode enum of the stream.
386+
387+
Values:
388+
WRITE_MODE_UNSPECIFIED (0):
389+
Unknown type.
390+
INSERT (1):
391+
Insert new records into the table.
392+
It is the default value if customers do not
393+
specify it.
394+
"""
345395
WRITE_MODE_UNSPECIFIED = 0
346396
INSERT = 1
347397

google/cloud/bigquery_storage_v1/types/table.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,43 @@ class TableFieldSchema(proto.Message):
123123
"""
124124

125125
class Type(proto.Enum):
126-
r""""""
126+
r"""
127+
128+
Values:
129+
TYPE_UNSPECIFIED (0):
130+
Illegal value
131+
STRING (1):
132+
64K, UTF8
133+
INT64 (2):
134+
64-bit signed
135+
DOUBLE (3):
136+
64-bit IEEE floating point
137+
STRUCT (4):
138+
Aggregate type
139+
BYTES (5):
140+
64K, Binary
141+
BOOL (6):
142+
2-valued
143+
TIMESTAMP (7):
144+
64-bit signed usec since UTC epoch
145+
DATE (8):
146+
Civil date - Year, Month, Day
147+
TIME (9):
148+
Civil time - Hour, Minute, Second,
149+
Microseconds
150+
DATETIME (10):
151+
Combination of civil date and civil time
152+
GEOGRAPHY (11):
153+
Geography object
154+
NUMERIC (12):
155+
Numeric value
156+
BIGNUMERIC (13):
157+
BigNumeric value
158+
INTERVAL (14):
159+
Interval
160+
JSON (15):
161+
JSON, String
162+
"""
127163
TYPE_UNSPECIFIED = 0
128164
STRING = 1
129165
INT64 = 2
@@ -142,7 +178,18 @@ class Type(proto.Enum):
142178
JSON = 15
143179

144180
class Mode(proto.Enum):
145-
r""""""
181+
r"""
182+
183+
Values:
184+
MODE_UNSPECIFIED (0):
185+
186+
NULLABLE (1):
187+
188+
REQUIRED (2):
189+
190+
REPEATED (3):
191+
192+
"""
146193
MODE_UNSPECIFIED = 0
147194
NULLABLE = 1
148195
REQUIRED = 2

google/cloud/bigquery_storage_v1beta2/services/big_query_read/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def sample_split_read_stream():
859859
# Done; return the response.
860860
return response
861861

862-
def __enter__(self):
862+
def __enter__(self) -> "BigQueryReadClient":
863863
return self
864864

865865
def __exit__(self, type, value, traceback):

google/cloud/bigquery_storage_v1beta2/services/big_query_write/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def sample_flush_rows():
11051105
# Done; return the response.
11061106
return response
11071107

1108-
def __enter__(self):
1108+
def __enter__(self) -> "BigQueryWriteClient":
11091109
return self
11101110

11111111
def __exit__(self, type, value, traceback):

google/cloud/bigquery_storage_v1beta2/types/arrow.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,19 @@ class ArrowSerializationOptions(proto.Message):
6969
"""
7070

7171
class Format(proto.Enum):
72-
r"""The IPC format to use when serializing Arrow streams."""
72+
r"""The IPC format to use when serializing Arrow streams.
73+
74+
Values:
75+
FORMAT_UNSPECIFIED (0):
76+
If unspecied the IPC format as of 0.15
77+
release will be used.
78+
ARROW_0_14 (1):
79+
Use the legacy IPC message format as of
80+
Apache Arrow Release 0.14.
81+
ARROW_0_15 (2):
82+
Use the message format as of Apache Arrow
83+
Release 0.15.
84+
"""
7385
FORMAT_UNSPECIFIED = 0
7486
ARROW_0_14 = 1
7587
ARROW_0_15 = 2

0 commit comments

Comments
 (0)