Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/google/cloud/bigquery/__init__.py: 98%

84 statements  

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

1# Copyright 2015 Google LLC 

2# 

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

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

5# You may obtain a copy of the License at 

6# 

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

8# 

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

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

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

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

13# limitations under the License. 

14 

15"""Google BigQuery API wrapper. 

16 

17The main concepts with this API are: 

18 

19- :class:`~google.cloud.bigquery.client.Client` manages connections to the 

20 BigQuery API. Use the client methods to run jobs (such as a 

21 :class:`~google.cloud.bigquery.job.QueryJob` via 

22 :meth:`~google.cloud.bigquery.client.Client.query`) and manage resources. 

23 

24- :class:`~google.cloud.bigquery.dataset.Dataset` represents a 

25 collection of tables. 

26 

27- :class:`~google.cloud.bigquery.table.Table` represents a single "relation". 

28""" 

29 

30 

31from google.cloud.bigquery import version as bigquery_version 

32 

33__version__ = bigquery_version.__version__ 

34 

35from google.cloud.bigquery.client import Client 

36from google.cloud.bigquery.dataset import AccessEntry 

37from google.cloud.bigquery.dataset import Dataset 

38from google.cloud.bigquery.dataset import DatasetReference 

39from google.cloud.bigquery import enums 

40from google.cloud.bigquery.enums import AutoRowIDs 

41from google.cloud.bigquery.enums import DecimalTargetType 

42from google.cloud.bigquery.enums import KeyResultStatementKind 

43from google.cloud.bigquery.enums import SqlTypeNames 

44from google.cloud.bigquery.enums import StandardSqlTypeNames 

45from google.cloud.bigquery.exceptions import LegacyBigQueryStorageError 

46from google.cloud.bigquery.exceptions import LegacyPyarrowError 

47from google.cloud.bigquery.external_config import ExternalConfig 

48from google.cloud.bigquery.external_config import BigtableOptions 

49from google.cloud.bigquery.external_config import BigtableColumnFamily 

50from google.cloud.bigquery.external_config import BigtableColumn 

51from google.cloud.bigquery.external_config import CSVOptions 

52from google.cloud.bigquery.external_config import GoogleSheetsOptions 

53from google.cloud.bigquery.external_config import ExternalSourceFormat 

54from google.cloud.bigquery.external_config import HivePartitioningOptions 

55from google.cloud.bigquery.format_options import AvroOptions 

56from google.cloud.bigquery.format_options import ParquetOptions 

57from google.cloud.bigquery.job.base import SessionInfo 

58from google.cloud.bigquery.job import Compression 

59from google.cloud.bigquery.job import CopyJob 

60from google.cloud.bigquery.job import CopyJobConfig 

61from google.cloud.bigquery.job import CreateDisposition 

62from google.cloud.bigquery.job import DestinationFormat 

63from google.cloud.bigquery.job import DmlStats 

64from google.cloud.bigquery.job import Encoding 

65from google.cloud.bigquery.job import ExtractJob 

66from google.cloud.bigquery.job import ExtractJobConfig 

67from google.cloud.bigquery.job import LoadJob 

68from google.cloud.bigquery.job import LoadJobConfig 

69from google.cloud.bigquery.job import OperationType 

70from google.cloud.bigquery.job import QueryJob 

71from google.cloud.bigquery.job import QueryJobConfig 

72from google.cloud.bigquery.job import QueryPriority 

73from google.cloud.bigquery.job import SchemaUpdateOption 

74from google.cloud.bigquery.job import ScriptOptions 

75from google.cloud.bigquery.job import SourceFormat 

76from google.cloud.bigquery.job import UnknownJob 

77from google.cloud.bigquery.job import TransactionInfo 

78from google.cloud.bigquery.job import WriteDisposition 

79from google.cloud.bigquery.model import Model 

80from google.cloud.bigquery.model import ModelReference 

81from google.cloud.bigquery.query import ArrayQueryParameter 

82from google.cloud.bigquery.query import ArrayQueryParameterType 

83from google.cloud.bigquery.query import ConnectionProperty 

84from google.cloud.bigquery.query import ScalarQueryParameter 

85from google.cloud.bigquery.query import ScalarQueryParameterType 

86from google.cloud.bigquery.query import SqlParameterScalarTypes 

87from google.cloud.bigquery.query import StructQueryParameter 

88from google.cloud.bigquery.query import StructQueryParameterType 

89from google.cloud.bigquery.query import UDFResource 

90from google.cloud.bigquery.retry import DEFAULT_RETRY 

91from google.cloud.bigquery.routine import DeterminismLevel 

92from google.cloud.bigquery.routine import Routine 

93from google.cloud.bigquery.routine import RoutineArgument 

94from google.cloud.bigquery.routine import RoutineReference 

95from google.cloud.bigquery.routine import RoutineType 

96from google.cloud.bigquery.schema import PolicyTagList 

97from google.cloud.bigquery.schema import SchemaField 

98from google.cloud.bigquery.standard_sql import StandardSqlDataType 

99from google.cloud.bigquery.standard_sql import StandardSqlField 

100from google.cloud.bigquery.standard_sql import StandardSqlStructType 

101from google.cloud.bigquery.standard_sql import StandardSqlTableType 

102from google.cloud.bigquery.table import PartitionRange 

103from google.cloud.bigquery.table import RangePartitioning 

104from google.cloud.bigquery.table import Row 

105from google.cloud.bigquery.table import SnapshotDefinition 

106from google.cloud.bigquery.table import CloneDefinition 

107from google.cloud.bigquery.table import Table 

108from google.cloud.bigquery.table import TableReference 

109from google.cloud.bigquery.table import TimePartitioningType 

110from google.cloud.bigquery.table import TimePartitioning 

111from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration 

112 

113__all__ = [ 

114 "__version__", 

115 "Client", 

116 # Queries 

117 "ConnectionProperty", 

118 "QueryJob", 

119 "QueryJobConfig", 

120 "ArrayQueryParameter", 

121 "ScalarQueryParameter", 

122 "StructQueryParameter", 

123 "ArrayQueryParameterType", 

124 "ScalarQueryParameterType", 

125 "SqlParameterScalarTypes", 

126 "StructQueryParameterType", 

127 # Datasets 

128 "Dataset", 

129 "DatasetReference", 

130 "AccessEntry", 

131 # Tables 

132 "Table", 

133 "TableReference", 

134 "PartitionRange", 

135 "RangePartitioning", 

136 "Row", 

137 "SnapshotDefinition", 

138 "CloneDefinition", 

139 "TimePartitioning", 

140 "TimePartitioningType", 

141 # Jobs 

142 "CopyJob", 

143 "CopyJobConfig", 

144 "ExtractJob", 

145 "ExtractJobConfig", 

146 "LoadJob", 

147 "LoadJobConfig", 

148 "SessionInfo", 

149 "UnknownJob", 

150 # Models 

151 "Model", 

152 "ModelReference", 

153 # Routines 

154 "Routine", 

155 "RoutineArgument", 

156 "RoutineReference", 

157 # Shared helpers 

158 "SchemaField", 

159 "PolicyTagList", 

160 "UDFResource", 

161 "ExternalConfig", 

162 "AvroOptions", 

163 "BigtableOptions", 

164 "BigtableColumnFamily", 

165 "BigtableColumn", 

166 "DmlStats", 

167 "CSVOptions", 

168 "GoogleSheetsOptions", 

169 "HivePartitioningOptions", 

170 "ParquetOptions", 

171 "ScriptOptions", 

172 "TransactionInfo", 

173 "DEFAULT_RETRY", 

174 # Standard SQL types 

175 "StandardSqlDataType", 

176 "StandardSqlField", 

177 "StandardSqlStructType", 

178 "StandardSqlTableType", 

179 # Enum Constants 

180 "enums", 

181 "AutoRowIDs", 

182 "Compression", 

183 "CreateDisposition", 

184 "DecimalTargetType", 

185 "DestinationFormat", 

186 "DeterminismLevel", 

187 "ExternalSourceFormat", 

188 "Encoding", 

189 "KeyResultStatementKind", 

190 "OperationType", 

191 "QueryPriority", 

192 "RoutineType", 

193 "SchemaUpdateOption", 

194 "SourceFormat", 

195 "SqlTypeNames", 

196 "StandardSqlTypeNames", 

197 "WriteDisposition", 

198 # EncryptionConfiguration 

199 "EncryptionConfiguration", 

200 # Custom exceptions 

201 "LegacyBigQueryStorageError", 

202 "LegacyPyarrowError", 

203] 

204 

205 

206def load_ipython_extension(ipython): 

207 """Called by IPython when this module is loaded as an IPython extension.""" 

208 from google.cloud.bigquery.magics.magics import _cell_magic 

209 

210 ipython.register_magic_function( 

211 _cell_magic, magic_kind="cell", magic_name="bigquery" 

212 )