Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/google/cloud/bigquery_storage_v1/types/protobuf.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.2.2, created at 2023-03-26 06:10 +0000

1# -*- coding: utf-8 -*- 

2# Copyright 2022 Google LLC 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, 

12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

13# See the License for the specific language governing permissions and 

14# limitations under the License. 

15# 

16from __future__ import annotations 

17 

18from typing import MutableMapping, MutableSequence 

19 

20import proto # type: ignore 

21 

22from google.protobuf import descriptor_pb2 # type: ignore 

23 

24 

25__protobuf__ = proto.module( 

26 package="google.cloud.bigquery.storage.v1", 

27 manifest={ 

28 "ProtoSchema", 

29 "ProtoRows", 

30 }, 

31) 

32 

33 

34class ProtoSchema(proto.Message): 

35 r"""ProtoSchema describes the schema of the serialized protocol 

36 buffer data rows. 

37 

38 Attributes: 

39 proto_descriptor (google.protobuf.descriptor_pb2.DescriptorProto): 

40 Descriptor for input message. The provided descriptor must 

41 be self contained, such that data rows sent can be fully 

42 decoded using only the single descriptor. For data rows that 

43 are compositions of multiple independent messages, this 

44 means the descriptor may need to be transformed to only use 

45 nested types: 

46 https://developers.google.com/protocol-buffers/docs/proto#nested 

47 

48 For additional information for how proto types and values 

49 map onto BigQuery see: 

50 https://cloud.google.com/bigquery/docs/write-api#data_type_conversions 

51 """ 

52 

53 proto_descriptor: descriptor_pb2.DescriptorProto = proto.Field( 

54 proto.MESSAGE, 

55 number=1, 

56 message=descriptor_pb2.DescriptorProto, 

57 ) 

58 

59 

60class ProtoRows(proto.Message): 

61 r""" 

62 

63 Attributes: 

64 serialized_rows (MutableSequence[bytes]): 

65 A sequence of rows serialized as a Protocol 

66 Buffer. 

67 See 

68 https://developers.google.com/protocol-buffers/docs/overview 

69 for more information on deserializing this 

70 field. 

71 """ 

72 

73 serialized_rows: MutableSequence[bytes] = proto.RepeatedField( 

74 proto.BYTES, 

75 number=1, 

76 ) 

77 

78 

79__all__ = tuple(sorted(__protobuf__.manifest))