google-cloud-bigquery 3.28.0__tar.gz → 3.29.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. {google_cloud_bigquery-3.28.0/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.29.0}/PKG-INFO +1 -1
  2. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/external_config.py +107 -0
  3. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/magics/magics.py +1 -1
  4. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/schema.py +6 -0
  5. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/table.py +35 -0
  6. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/version.py +1 -1
  7. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0/google_cloud_bigquery.egg-info}/PKG-INFO +1 -1
  8. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_external_config.py +137 -0
  9. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_table.py +87 -0
  10. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/LICENSE +0 -0
  11. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/MANIFEST.in +0 -0
  12. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/README.rst +0 -0
  13. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/__init__.py +0 -0
  14. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/_helpers.py +0 -0
  15. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/_http.py +0 -0
  16. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/_job_helpers.py +0 -0
  17. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/_pandas_helpers.py +0 -0
  18. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
  19. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
  20. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/_versions_helpers.py +0 -0
  21. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/client.py +0 -0
  22. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/dataset.py +0 -0
  23. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/dbapi/__init__.py +0 -0
  24. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
  25. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/dbapi/connection.py +0 -0
  26. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/dbapi/cursor.py +0 -0
  27. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
  28. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/dbapi/types.py +0 -0
  29. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/encryption_configuration.py +0 -0
  30. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/enums.py +0 -0
  31. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/exceptions.py +0 -0
  32. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/format_options.py +0 -0
  33. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/iam.py +0 -0
  34. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/job/__init__.py +0 -0
  35. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/job/base.py +0 -0
  36. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/job/copy_.py +0 -0
  37. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/job/extract.py +0 -0
  38. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/job/load.py +0 -0
  39. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/job/query.py +0 -0
  40. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/magics/__init__.py +0 -0
  41. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
  42. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
  43. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
  44. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
  45. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
  46. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/model.py +0 -0
  47. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
  48. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/py.typed +0 -0
  49. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/query.py +0 -0
  50. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/retry.py +0 -0
  51. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/routine/__init__.py +0 -0
  52. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/routine/routine.py +0 -0
  53. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery/standard_sql.py +0 -0
  54. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery_v2/__init__.py +0 -0
  55. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery_v2/types/__init__.py +0 -0
  56. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
  57. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery_v2/types/model.py +0 -0
  58. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
  59. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
  60. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
  61. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google_cloud_bigquery.egg-info/SOURCES.txt +0 -0
  62. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
  63. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google_cloud_bigquery.egg-info/requires.txt +0 -0
  64. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
  65. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/pyproject.toml +0 -0
  66. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/setup.cfg +0 -0
  67. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/setup.py +0 -0
  68. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/__init__.py +0 -0
  69. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/characters.json +0 -0
  70. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/characters.jsonl +0 -0
  71. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/colors.avro +0 -0
  72. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/numeric_38_12.parquet +0 -0
  73. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/people.csv +0 -0
  74. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/scalars.csv +0 -0
  75. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/scalars.jsonl +0 -0
  76. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/scalars_extreme.jsonl +0 -0
  77. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/scalars_schema.json +0 -0
  78. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/scalars_schema_csv.json +0 -0
  79. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/data/schema.json +0 -0
  80. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/scrub_datasets.py +0 -0
  81. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/__init__.py +0 -0
  82. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/conftest.py +0 -0
  83. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/helpers.py +0 -0
  84. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_arrow.py +0 -0
  85. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_client.py +0 -0
  86. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_job_retry.py +0 -0
  87. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_list_rows.py +0 -0
  88. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_magics.py +0 -0
  89. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_pandas.py +0 -0
  90. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_query.py +0 -0
  91. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/system/test_structs.py +0 -0
  92. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/__init__.py +0 -0
  93. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/_helpers/__init__.py +0 -0
  94. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/_helpers/test_from_json.py +0 -0
  95. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/conftest.py +0 -0
  96. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/helpers.py +0 -0
  97. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/__init__.py +0 -0
  98. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/helpers.py +0 -0
  99. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_base.py +0 -0
  100. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_copy.py +0 -0
  101. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_extract.py +0 -0
  102. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_load.py +0 -0
  103. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_load_config.py +0 -0
  104. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_query.py +0 -0
  105. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_query_config.py +0 -0
  106. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_query_pandas.py +0 -0
  107. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/job/test_query_stats.py +0 -0
  108. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/line_arg_parser/__init__.py +0 -0
  109. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/line_arg_parser/test_lexer.py +0 -0
  110. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/line_arg_parser/test_parser.py +0 -0
  111. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/line_arg_parser/test_visitors.py +0 -0
  112. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/model/__init__.py +0 -0
  113. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/model/test_model.py +0 -0
  114. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/model/test_model_reference.py +0 -0
  115. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/routine/__init__.py +0 -0
  116. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/routine/test_remote_function_options.py +0 -0
  117. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/routine/test_routine.py +0 -0
  118. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/routine/test_routine_argument.py +0 -0
  119. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/routine/test_routine_reference.py +0 -0
  120. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test__helpers.py +0 -0
  121. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test__http.py +0 -0
  122. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test__job_helpers.py +0 -0
  123. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test__pandas_helpers.py +0 -0
  124. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test__pyarrow_helpers.py +0 -0
  125. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test__versions_helpers.py +0 -0
  126. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_client.py +0 -0
  127. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_create_dataset.py +0 -0
  128. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_dataset.py +0 -0
  129. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_dbapi__helpers.py +0 -0
  130. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_dbapi_connection.py +0 -0
  131. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_dbapi_cursor.py +0 -0
  132. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_dbapi_types.py +0 -0
  133. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_delete_dataset.py +0 -0
  134. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_encryption_configuration.py +0 -0
  135. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_format_options.py +0 -0
  136. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_job_retry.py +0 -0
  137. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_legacy_types.py +0 -0
  138. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_list_datasets.py +0 -0
  139. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_list_jobs.py +0 -0
  140. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_list_models.py +0 -0
  141. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_list_projects.py +0 -0
  142. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_list_routines.py +0 -0
  143. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_list_tables.py +0 -0
  144. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_magics.py +0 -0
  145. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_opentelemetry_tracing.py +0 -0
  146. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_packaging.py +0 -0
  147. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_query.py +0 -0
  148. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_retry.py +0 -0
  149. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_schema.py +0 -0
  150. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_signature_compatibility.py +0 -0
  151. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_standard_sql_types.py +0 -0
  152. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_table_arrow.py +0 -0
  153. {google_cloud_bigquery-3.28.0 → google_cloud_bigquery-3.29.0}/tests/unit/test_table_pandas.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: google-cloud-bigquery
3
- Version: 3.28.0
3
+ Version: 3.29.0
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
@@ -30,6 +30,7 @@ from google.cloud.bigquery._helpers import _int_or_none
30
30
  from google.cloud.bigquery._helpers import _str_or_none
31
31
  from google.cloud.bigquery import _helpers
32
32
  from google.cloud.bigquery.format_options import AvroOptions, ParquetOptions
33
+ from google.cloud.bigquery import schema
33
34
  from google.cloud.bigquery.schema import SchemaField
34
35
 
35
36
 
@@ -1077,3 +1078,109 @@ class ExternalCatalogDatasetOptions:
1077
1078
  config = cls()
1078
1079
  config._properties = api_repr
1079
1080
  return config
1081
+
1082
+
1083
+ class ExternalCatalogTableOptions:
1084
+ """Metadata about open source compatible table. The fields contained in these
1085
+ options correspond to hive metastore's table level properties.
1086
+
1087
+ Args:
1088
+ connection_id (Optional[str]): The connection specifying the credentials to be
1089
+ used to read external storage, such as Azure Blob, Cloud Storage, or
1090
+ S3. The connection is needed to read the open source table from
1091
+ BigQuery Engine. The connection_id can have the form `..` or
1092
+ `projects//locations//connections/`.
1093
+ parameters (Union[Dict[str, Any], None]): A map of key value pairs defining the parameters
1094
+ and properties of the open source table. Corresponds with hive meta
1095
+ store table parameters. Maximum size of 4Mib.
1096
+ storage_descriptor (Optional[StorageDescriptor]): A storage descriptor containing information
1097
+ about the physical storage of this table.
1098
+ """
1099
+
1100
+ def __init__(
1101
+ self,
1102
+ connection_id: Optional[str] = None,
1103
+ parameters: Union[Dict[str, Any], None] = None,
1104
+ storage_descriptor: Optional[schema.StorageDescriptor] = None,
1105
+ ):
1106
+ self._properties: Dict[str, Any] = {}
1107
+ self.connection_id = connection_id
1108
+ self.parameters = parameters
1109
+ self.storage_descriptor = storage_descriptor
1110
+
1111
+ @property
1112
+ def connection_id(self) -> Optional[str]:
1113
+ """Optional. The connection specifying the credentials to be
1114
+ used to read external storage, such as Azure Blob, Cloud Storage, or
1115
+ S3. The connection is needed to read the open source table from
1116
+ BigQuery Engine. The connection_id can have the form `..` or
1117
+ `projects//locations//connections/`.
1118
+ """
1119
+
1120
+ return self._properties.get("connectionId")
1121
+
1122
+ @connection_id.setter
1123
+ def connection_id(self, value: Optional[str]):
1124
+ value = _helpers._isinstance_or_raise(value, str, none_allowed=True)
1125
+ self._properties["connectionId"] = value
1126
+
1127
+ @property
1128
+ def parameters(self) -> Union[Dict[str, Any], None]:
1129
+ """Optional. A map of key value pairs defining the parameters and
1130
+ properties of the open source table. Corresponds with hive meta
1131
+ store table parameters. Maximum size of 4Mib.
1132
+ """
1133
+
1134
+ return self._properties.get("parameters")
1135
+
1136
+ @parameters.setter
1137
+ def parameters(self, value: Union[Dict[str, Any], None]):
1138
+ value = _helpers._isinstance_or_raise(value, dict, none_allowed=True)
1139
+ self._properties["parameters"] = value
1140
+
1141
+ @property
1142
+ def storage_descriptor(self) -> Any:
1143
+ """Optional. A storage descriptor containing information about the
1144
+ physical storage of this table."""
1145
+
1146
+ prop = _helpers._get_sub_prop(self._properties, ["storageDescriptor"])
1147
+
1148
+ if prop is not None:
1149
+ return schema.StorageDescriptor.from_api_repr(prop)
1150
+ return None
1151
+
1152
+ @storage_descriptor.setter
1153
+ def storage_descriptor(self, value: Union[schema.StorageDescriptor, dict, None]):
1154
+ value = _helpers._isinstance_or_raise(
1155
+ value, (schema.StorageDescriptor, dict), none_allowed=True
1156
+ )
1157
+ if isinstance(value, schema.StorageDescriptor):
1158
+ self._properties["storageDescriptor"] = value.to_api_repr()
1159
+ else:
1160
+ self._properties["storageDescriptor"] = value
1161
+
1162
+ def to_api_repr(self) -> dict:
1163
+ """Build an API representation of this object.
1164
+
1165
+ Returns:
1166
+ Dict[str, Any]:
1167
+ A dictionary in the format used by the BigQuery API.
1168
+ """
1169
+
1170
+ return self._properties
1171
+
1172
+ @classmethod
1173
+ def from_api_repr(cls, api_repr: dict) -> ExternalCatalogTableOptions:
1174
+ """Factory: constructs an instance of the class (cls)
1175
+ given its API representation.
1176
+
1177
+ Args:
1178
+ api_repr (Dict[str, Any]):
1179
+ API representation of the object to be instantiated.
1180
+
1181
+ Returns:
1182
+ An instance of the class initialized with data from 'api_repr'.
1183
+ """
1184
+ config = cls()
1185
+ config._properties = api_repr
1186
+ return config
@@ -56,7 +56,7 @@ except ImportError:
56
56
  bigquery_magics = None
57
57
 
58
58
 
59
- IPYTHON_USER_AGENT = "ipython-{}".format(IPython.__version__)
59
+ IPYTHON_USER_AGENT = "ipython-{}".format(IPython.__version__) # type: ignore
60
60
 
61
61
 
62
62
  class Context(object):
@@ -228,6 +228,12 @@ class SchemaField(object):
228
228
  # fields. See https://github.com/googleapis/python-bigquery/issues/6
229
229
  placeholder._properties = api_repr
230
230
 
231
+ # Add the field `mode` with default value if it does not exist. Fixes
232
+ # an incompatibility issue with pandas-gbq:
233
+ # https://github.com/googleapis/python-bigquery-pandas/issues/854
234
+ if "mode" not in placeholder._properties:
235
+ placeholder._properties["mode"] = "NULLABLE"
236
+
231
237
  return placeholder
232
238
 
233
239
  @property
@@ -69,6 +69,7 @@ from google.cloud.bigquery.external_config import ExternalConfig
69
69
  from google.cloud.bigquery.schema import _build_schema_resource
70
70
  from google.cloud.bigquery.schema import _parse_schema_resource
71
71
  from google.cloud.bigquery.schema import _to_schema_fields
72
+ from google.cloud.bigquery import external_config
72
73
 
73
74
  if typing.TYPE_CHECKING: # pragma: NO COVER
74
75
  # Unconditionally import optional dependencies again to tell pytype that
@@ -408,6 +409,7 @@ class Table(_TableBase):
408
409
  "require_partition_filter": "requirePartitionFilter",
409
410
  "table_constraints": "tableConstraints",
410
411
  "max_staleness": "maxStaleness",
412
+ "external_catalog_table_options": "externalCatalogTableOptions",
411
413
  }
412
414
 
413
415
  def __init__(self, table_ref, schema=None) -> None:
@@ -1023,6 +1025,39 @@ class Table(_TableBase):
1023
1025
  table_constraints = TableConstraints.from_api_repr(table_constraints)
1024
1026
  return table_constraints
1025
1027
 
1028
+ @property
1029
+ def external_catalog_table_options(
1030
+ self,
1031
+ ) -> Optional[external_config.ExternalCatalogTableOptions]:
1032
+ """Options defining open source compatible datasets living in the
1033
+ BigQuery catalog. Contains metadata of open source database, schema
1034
+ or namespace represented by the current dataset."""
1035
+
1036
+ prop = self._properties.get(
1037
+ self._PROPERTY_TO_API_FIELD["external_catalog_table_options"]
1038
+ )
1039
+ if prop is not None:
1040
+ return external_config.ExternalCatalogTableOptions.from_api_repr(prop)
1041
+ return None
1042
+
1043
+ @external_catalog_table_options.setter
1044
+ def external_catalog_table_options(
1045
+ self, value: Union[external_config.ExternalCatalogTableOptions, dict, None]
1046
+ ):
1047
+ value = _helpers._isinstance_or_raise(
1048
+ value,
1049
+ (external_config.ExternalCatalogTableOptions, dict),
1050
+ none_allowed=True,
1051
+ )
1052
+ if isinstance(value, external_config.ExternalCatalogTableOptions):
1053
+ self._properties[
1054
+ self._PROPERTY_TO_API_FIELD["external_catalog_table_options"]
1055
+ ] = value.to_api_repr()
1056
+ else:
1057
+ self._properties[
1058
+ self._PROPERTY_TO_API_FIELD["external_catalog_table_options"]
1059
+ ] = value
1060
+
1026
1061
  @classmethod
1027
1062
  def from_string(cls, full_table_id: str) -> "Table":
1028
1063
  """Construct a table from fully-qualified table ID.
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "3.28.0"
15
+ __version__ = "3.29.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: google-cloud-bigquery
3
- Version: 3.28.0
3
+ Version: 3.29.0
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
@@ -14,6 +14,7 @@
14
14
 
15
15
  import base64
16
16
  import copy
17
+ from typing import Any, Dict, Optional
17
18
  import unittest
18
19
 
19
20
  from google.cloud.bigquery import external_config
@@ -979,3 +980,139 @@ class TestExternalCatalogDatasetOptions:
979
980
 
980
981
  assert isinstance(result, external_config.ExternalCatalogDatasetOptions)
981
982
  assert result._properties == api_repr
983
+
984
+
985
+ class TestExternalCatalogTableOptions:
986
+ @staticmethod
987
+ def _get_target_class():
988
+ from google.cloud.bigquery.external_config import ExternalCatalogTableOptions
989
+
990
+ return ExternalCatalogTableOptions
991
+
992
+ def _make_one(self, *args, **kw):
993
+ return self._get_target_class()(*args, **kw)
994
+
995
+ storage_descriptor_repr = {
996
+ "inputFormat": "testpath.to.OrcInputFormat",
997
+ "locationUri": "gs://test/path/",
998
+ "outputFormat": "testpath.to.OrcOutputFormat",
999
+ "serDeInfo": {
1000
+ "serializationLibrary": "testpath.to.LazySimpleSerDe",
1001
+ "name": "serde_lib_name",
1002
+ "parameters": {"key": "value"},
1003
+ },
1004
+ }
1005
+
1006
+ CONNECTIONID = "connection123"
1007
+ PARAMETERS = {"key": "value"}
1008
+ STORAGEDESCRIPTOR = schema.StorageDescriptor.from_api_repr(storage_descriptor_repr)
1009
+ EXTERNALCATALOGTABLEOPTIONS = {
1010
+ "connectionId": "connection123",
1011
+ "parameters": {"key": "value"},
1012
+ "storageDescriptor": STORAGEDESCRIPTOR.to_api_repr(),
1013
+ }
1014
+
1015
+ @pytest.mark.parametrize(
1016
+ "connection_id,parameters,storage_descriptor",
1017
+ [
1018
+ (
1019
+ CONNECTIONID,
1020
+ PARAMETERS,
1021
+ STORAGEDESCRIPTOR,
1022
+ ), # set all parameters at once
1023
+ (CONNECTIONID, None, None), # set only one parameter at a time
1024
+ (None, PARAMETERS, None),
1025
+ (None, None, STORAGEDESCRIPTOR), # set storage descriptor using obj
1026
+ (None, None, storage_descriptor_repr), # set storage descriptor using dict
1027
+ (None, None, None), # use default parameters
1028
+ ],
1029
+ )
1030
+ def test_ctor_initialization(
1031
+ self,
1032
+ connection_id,
1033
+ parameters,
1034
+ storage_descriptor,
1035
+ ):
1036
+ instance = self._make_one(
1037
+ connection_id=connection_id,
1038
+ parameters=parameters,
1039
+ storage_descriptor=storage_descriptor,
1040
+ )
1041
+
1042
+ assert instance.connection_id == connection_id
1043
+ assert instance.parameters == parameters
1044
+
1045
+ if isinstance(storage_descriptor, schema.StorageDescriptor):
1046
+ assert (
1047
+ instance.storage_descriptor.to_api_repr()
1048
+ == storage_descriptor.to_api_repr()
1049
+ )
1050
+ elif isinstance(storage_descriptor, dict):
1051
+ assert instance.storage_descriptor.to_api_repr() == storage_descriptor
1052
+ else:
1053
+ assert instance.storage_descriptor is None
1054
+
1055
+ @pytest.mark.parametrize(
1056
+ "connection_id,parameters,storage_descriptor",
1057
+ [
1058
+ pytest.param(
1059
+ 123,
1060
+ PARAMETERS,
1061
+ STORAGEDESCRIPTOR,
1062
+ id="connection_id-invalid-type",
1063
+ ),
1064
+ pytest.param(
1065
+ CONNECTIONID,
1066
+ 123,
1067
+ STORAGEDESCRIPTOR,
1068
+ id="parameters-invalid-type",
1069
+ ),
1070
+ pytest.param(
1071
+ CONNECTIONID,
1072
+ PARAMETERS,
1073
+ 123,
1074
+ id="storage_descriptor-invalid-type",
1075
+ ),
1076
+ ],
1077
+ )
1078
+ def test_ctor_invalid_input(
1079
+ self,
1080
+ connection_id: str,
1081
+ parameters: Dict[str, Any],
1082
+ storage_descriptor: Optional[schema.StorageDescriptor],
1083
+ ):
1084
+ with pytest.raises(TypeError) as e:
1085
+ external_config.ExternalCatalogTableOptions(
1086
+ connection_id=connection_id,
1087
+ parameters=parameters,
1088
+ storage_descriptor=storage_descriptor,
1089
+ )
1090
+
1091
+ # Looking for the first word from the string "Pass <variable> as..."
1092
+ assert "Pass " in str(e.value)
1093
+
1094
+ def test_to_api_repr(self):
1095
+ instance = self._make_one(
1096
+ connection_id=self.CONNECTIONID,
1097
+ parameters=self.PARAMETERS,
1098
+ storage_descriptor=self.STORAGEDESCRIPTOR,
1099
+ )
1100
+
1101
+ result = instance.to_api_repr()
1102
+ expected = self.EXTERNALCATALOGTABLEOPTIONS
1103
+
1104
+ assert result == expected
1105
+
1106
+ def test_from_api_repr(self):
1107
+ result = self._make_one(
1108
+ connection_id=self.CONNECTIONID,
1109
+ parameters=self.PARAMETERS,
1110
+ storage_descriptor=self.STORAGEDESCRIPTOR,
1111
+ )
1112
+
1113
+ instance = self._make_one()
1114
+ api_repr = self.EXTERNALCATALOGTABLEOPTIONS
1115
+ result = instance.from_api_repr(api_repr)
1116
+
1117
+ assert isinstance(result, external_config.ExternalCatalogTableOptions)
1118
+ assert result._properties == api_repr
@@ -30,6 +30,7 @@ from test_utils.imports import maybe_fail_import
30
30
 
31
31
  from google.cloud.bigquery import _versions_helpers
32
32
  from google.cloud.bigquery import exceptions
33
+ from google.cloud.bigquery import external_config
33
34
  from google.cloud.bigquery.table import TableReference
34
35
  from google.cloud.bigquery.dataset import DatasetReference
35
36
 
@@ -5879,6 +5880,92 @@ class TestTableConstraint(unittest.TestCase):
5879
5880
  self.assertIsNotNone(instance.foreign_keys)
5880
5881
 
5881
5882
 
5883
+ class TestExternalCatalogTableOptions:
5884
+ PROJECT = "test-project"
5885
+ DATASET_ID = "test_dataset"
5886
+ TABLE_ID = "coffee_table"
5887
+ DATASET = DatasetReference(PROJECT, DATASET_ID)
5888
+ TABLEREF = DATASET.table(TABLE_ID)
5889
+
5890
+ @staticmethod
5891
+ def _get_target_class(self):
5892
+ from google.cloud.bigquery.table import Table
5893
+
5894
+ return Table
5895
+
5896
+ def _make_one(self, *args, **kw):
5897
+ return self._get_target_class(self)(*args, **kw)
5898
+
5899
+ EXTERNALCATALOGTABLEOPTIONS = {
5900
+ "connection_id": "connection123",
5901
+ "parameters": {"key": "value"},
5902
+ "storage_descriptor": {
5903
+ "input_format": "testpath.to.OrcInputFormat",
5904
+ "location_uri": "gs://test/path/",
5905
+ "output_format": "testpath.to.OrcOutputFormat",
5906
+ "serde_info": {
5907
+ "serialization_library": "testpath.to.LazySimpleSerDe",
5908
+ "name": "serde_lib_name",
5909
+ "parameters": {"key": "value"},
5910
+ },
5911
+ },
5912
+ }
5913
+
5914
+ def test_external_catalog_table_options_default_initialization(self):
5915
+ table = self._make_one(self.TABLEREF)
5916
+
5917
+ assert table.external_catalog_table_options is None
5918
+
5919
+ def test_external_catalog_table_options_valid_inputs(self):
5920
+ table = self._make_one(self.TABLEREF)
5921
+
5922
+ # supplied in api_repr format
5923
+ table.external_catalog_table_options = self.EXTERNALCATALOGTABLEOPTIONS
5924
+ result = table.external_catalog_table_options.to_api_repr()
5925
+ expected = self.EXTERNALCATALOGTABLEOPTIONS
5926
+ assert result == expected
5927
+
5928
+ # supplied in obj format
5929
+ ecto = external_config.ExternalCatalogTableOptions.from_api_repr(
5930
+ self.EXTERNALCATALOGTABLEOPTIONS
5931
+ )
5932
+ assert isinstance(ecto, external_config.ExternalCatalogTableOptions)
5933
+
5934
+ table.external_catalog_table_options = ecto
5935
+ result = table.external_catalog_table_options.to_api_repr()
5936
+ expected = self.EXTERNALCATALOGTABLEOPTIONS
5937
+ assert result == expected
5938
+
5939
+ def test_external_catalog_table_options_invalid_input(self):
5940
+ table = self._make_one(self.TABLEREF)
5941
+
5942
+ # invalid on the whole
5943
+ with pytest.raises(TypeError) as e:
5944
+ table.external_catalog_table_options = 123
5945
+
5946
+ # Looking for the first word from the string "Pass <variable> as..."
5947
+ assert "Pass " in str(e.value)
5948
+
5949
+ def test_external_catalog_table_options_to_api_repr(self):
5950
+ table = self._make_one(self.TABLEREF)
5951
+
5952
+ table.external_catalog_table_options = self.EXTERNALCATALOGTABLEOPTIONS
5953
+ result = table.external_catalog_table_options.to_api_repr()
5954
+ expected = self.EXTERNALCATALOGTABLEOPTIONS
5955
+ assert result == expected
5956
+
5957
+ def test_external_catalog_table_options_from_api_repr(self):
5958
+ table = self._make_one(self.TABLEREF)
5959
+
5960
+ table.external_catalog_table_options = self.EXTERNALCATALOGTABLEOPTIONS
5961
+ ecto = external_config.ExternalCatalogTableOptions.from_api_repr(
5962
+ self.EXTERNALCATALOGTABLEOPTIONS
5963
+ )
5964
+ result = ecto.to_api_repr()
5965
+ expected = self.EXTERNALCATALOGTABLEOPTIONS
5966
+ assert result == expected
5967
+
5968
+
5882
5969
  @pytest.mark.parametrize(
5883
5970
  "table_path",
5884
5971
  (