google-cloud-bigquery 3.32.0__tar.gz → 3.34.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 (155) hide show
  1. {google_cloud_bigquery-3.32.0/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.34.0}/PKG-INFO +6 -3
  2. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/_helpers.py +1 -1
  3. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/_job_helpers.py +2 -10
  4. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/_pandas_helpers.py +67 -89
  5. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/client.py +27 -8
  6. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/dataset.py +2 -2
  7. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/enums.py +19 -0
  8. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/job/base.py +32 -0
  9. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/job/query.py +37 -1
  10. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/schema.py +11 -17
  11. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/table.py +48 -11
  12. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/version.py +1 -1
  13. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0/google_cloud_bigquery.egg-info}/PKG-INFO +6 -3
  14. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google_cloud_bigquery.egg-info/requires.txt +10 -2
  15. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/pyproject.toml +6 -2
  16. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_client.py +47 -0
  17. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/helpers.py +3 -1
  18. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_base.py +43 -1
  19. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_query_pandas.py +6 -0
  20. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test__job_helpers.py +6 -6
  21. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test__pandas_helpers.py +38 -78
  22. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test__pyarrow_helpers.py +1 -1
  23. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_client.py +67 -25
  24. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_dataset.py +47 -1
  25. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_dbapi__helpers.py +1 -0
  26. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_dbapi_cursor.py +0 -1
  27. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_magics.py +33 -2
  28. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_opentelemetry_tracing.py +0 -1
  29. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_query.py +9 -8
  30. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_schema.py +0 -5
  31. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_table.py +39 -13
  32. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_table_arrow.py +2 -1
  33. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_table_pandas.py +103 -0
  34. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/LICENSE +0 -0
  35. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/MANIFEST.in +0 -0
  36. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/README.rst +0 -0
  37. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/__init__.py +0 -0
  38. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/_http.py +0 -0
  39. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
  40. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
  41. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/_versions_helpers.py +0 -0
  42. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/dbapi/__init__.py +0 -0
  43. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
  44. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/dbapi/connection.py +0 -0
  45. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/dbapi/cursor.py +0 -0
  46. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
  47. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/dbapi/types.py +0 -0
  48. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/encryption_configuration.py +0 -0
  49. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/exceptions.py +0 -0
  50. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/external_config.py +0 -0
  51. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/format_options.py +0 -0
  52. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/iam.py +0 -0
  53. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/job/__init__.py +0 -0
  54. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/job/copy_.py +0 -0
  55. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/job/extract.py +0 -0
  56. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/job/load.py +0 -0
  57. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/magics/__init__.py +0 -0
  58. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
  59. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
  60. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
  61. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
  62. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
  63. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/magics/magics.py +0 -0
  64. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/model.py +0 -0
  65. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
  66. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/py.typed +0 -0
  67. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/query.py +0 -0
  68. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/retry.py +0 -0
  69. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/routine/__init__.py +0 -0
  70. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/routine/routine.py +0 -0
  71. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery/standard_sql.py +0 -0
  72. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery_v2/__init__.py +0 -0
  73. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery_v2/types/__init__.py +0 -0
  74. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
  75. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery_v2/types/model.py +0 -0
  76. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
  77. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
  78. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
  79. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google_cloud_bigquery.egg-info/SOURCES.txt +0 -0
  80. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
  81. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
  82. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/setup.cfg +0 -0
  83. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/setup.py +0 -0
  84. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/__init__.py +0 -0
  85. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/characters.json +0 -0
  86. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/characters.jsonl +0 -0
  87. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/colors.avro +0 -0
  88. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/numeric_38_12.parquet +0 -0
  89. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/people.csv +0 -0
  90. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/scalars.csv +0 -0
  91. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/scalars.jsonl +0 -0
  92. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/scalars_extreme.jsonl +0 -0
  93. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/scalars_schema.json +0 -0
  94. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/scalars_schema_csv.json +0 -0
  95. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/data/schema.json +0 -0
  96. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/scrub_datasets.py +0 -0
  97. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/__init__.py +0 -0
  98. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/conftest.py +0 -0
  99. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/helpers.py +0 -0
  100. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_arrow.py +0 -0
  101. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_job_retry.py +0 -0
  102. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_list_rows.py +0 -0
  103. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_magics.py +0 -0
  104. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_pandas.py +0 -0
  105. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_query.py +0 -0
  106. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/system/test_structs.py +0 -0
  107. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/__init__.py +0 -0
  108. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/_helpers/__init__.py +0 -0
  109. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/_helpers/test_cell_data_parser.py +0 -0
  110. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/_helpers/test_data_frame_cell_data_parser.py +0 -0
  111. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/_helpers/test_scalar_query_param_parser.py +0 -0
  112. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/conftest.py +0 -0
  113. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/helpers.py +0 -0
  114. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/__init__.py +0 -0
  115. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_copy.py +0 -0
  116. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_extract.py +0 -0
  117. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_load.py +0 -0
  118. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_load_config.py +0 -0
  119. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_query.py +0 -0
  120. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_query_config.py +0 -0
  121. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/job/test_query_stats.py +0 -0
  122. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/line_arg_parser/__init__.py +0 -0
  123. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/line_arg_parser/test_lexer.py +0 -0
  124. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/line_arg_parser/test_parser.py +0 -0
  125. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/line_arg_parser/test_visitors.py +0 -0
  126. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/model/__init__.py +0 -0
  127. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/model/test_model.py +0 -0
  128. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/model/test_model_reference.py +0 -0
  129. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/routine/__init__.py +0 -0
  130. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/routine/test_remote_function_options.py +0 -0
  131. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/routine/test_routine.py +0 -0
  132. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/routine/test_routine_argument.py +0 -0
  133. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/routine/test_routine_reference.py +0 -0
  134. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test__helpers.py +0 -0
  135. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test__http.py +0 -0
  136. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test__versions_helpers.py +0 -0
  137. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_create_dataset.py +0 -0
  138. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_dbapi_connection.py +0 -0
  139. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_dbapi_types.py +0 -0
  140. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_delete_dataset.py +0 -0
  141. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_encryption_configuration.py +0 -0
  142. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_external_config.py +0 -0
  143. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_format_options.py +0 -0
  144. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_job_retry.py +0 -0
  145. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_legacy_types.py +0 -0
  146. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_list_datasets.py +0 -0
  147. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_list_jobs.py +0 -0
  148. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_list_models.py +0 -0
  149. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_list_projects.py +0 -0
  150. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_list_routines.py +0 -0
  151. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_list_tables.py +0 -0
  152. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_packaging.py +0 -0
  153. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_retry.py +0 -0
  154. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_signature_compatibility.py +0 -0
  155. {google_cloud_bigquery-3.32.0 → google_cloud_bigquery-3.34.0}/tests/unit/test_standard_sql_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: google-cloud-bigquery
3
- Version: 3.32.0
3
+ Version: 3.34.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
@@ -48,8 +48,11 @@ Requires-Dist: Shapely<3.0.0,>=1.8.4; extra == "geopandas"
48
48
  Provides-Extra: ipython
49
49
  Requires-Dist: ipython>=7.23.1; extra == "ipython"
50
50
  Requires-Dist: bigquery-magics>=0.6.0; extra == "ipython"
51
+ Provides-Extra: matplotlib
52
+ Requires-Dist: matplotlib<=3.9.2,>=3.7.1; python_version == "3.9" and extra == "matplotlib"
53
+ Requires-Dist: matplotlib>=3.10.3; python_version >= "3.10" and extra == "matplotlib"
51
54
  Provides-Extra: tqdm
52
- Requires-Dist: tqdm<5.0.0,>=4.7.4; extra == "tqdm"
55
+ Requires-Dist: tqdm<5.0.0,>=4.23.4; extra == "tqdm"
53
56
  Provides-Extra: opentelemetry
54
57
  Requires-Dist: opentelemetry-api>=1.1.0; extra == "opentelemetry"
55
58
  Requires-Dist: opentelemetry-sdk>=1.1.0; extra == "opentelemetry"
@@ -58,7 +61,7 @@ Provides-Extra: bigquery-v2
58
61
  Requires-Dist: proto-plus<2.0.0,>=1.22.3; extra == "bigquery-v2"
59
62
  Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.20.2; extra == "bigquery-v2"
60
63
  Provides-Extra: all
61
- Requires-Dist: google-cloud-bigquery[bigquery_v2,bqstorage,geopandas,ipython,ipywidgets,opentelemetry,pandas,tqdm]; extra == "all"
64
+ Requires-Dist: google-cloud-bigquery[bigquery_v2,bqstorage,geopandas,ipython,ipywidgets,matplotlib,opentelemetry,pandas,tqdm]; extra == "all"
62
65
 
63
66
  Python Client for Google BigQuery
64
67
  =================================
@@ -388,7 +388,7 @@ CELL_DATA_PARSER = CellDataParser()
388
388
 
389
389
 
390
390
  class DataFrameCellDataParser(CellDataParser):
391
- """Override of CellDataParser to handle differences in expection of values in DataFrame-like outputs.
391
+ """Override of CellDataParser to handle differences in expression of values in DataFrame-like outputs.
392
392
 
393
393
  This is used to turn the output of the REST API into a pyarrow Table,
394
394
  emulating the serialized arrow from the BigQuery Storage Read API.
@@ -37,7 +37,6 @@ predicates where it is safe to generate a new query ID.
37
37
 
38
38
  import copy
39
39
  import functools
40
- import os
41
40
  import uuid
42
41
  import textwrap
43
42
  from typing import Any, Dict, Optional, TYPE_CHECKING, Union
@@ -400,12 +399,6 @@ def query_and_wait(
400
399
  ) -> table.RowIterator:
401
400
  """Run the query, wait for it to finish, and return the results.
402
401
 
403
- While ``jobCreationMode=JOB_CREATION_OPTIONAL`` is in preview in the
404
- ``jobs.query`` REST API, use the default ``jobCreationMode`` unless
405
- the environment variable ``QUERY_PREVIEW_ENABLED=true``. After
406
- ``jobCreationMode`` is GA, this method will always use
407
- ``jobCreationMode=JOB_CREATION_OPTIONAL``. See:
408
- https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query
409
402
 
410
403
  Args:
411
404
  client:
@@ -500,9 +493,8 @@ def query_and_wait(
500
493
  request_body["maxResults"] = min(page_size, max_results)
501
494
  elif page_size is not None or max_results is not None:
502
495
  request_body["maxResults"] = page_size or max_results
503
-
504
- if os.getenv("QUERY_PREVIEW_ENABLED", "").casefold() == "true":
505
- request_body["jobCreationMode"] = "JOB_CREATION_OPTIONAL"
496
+ if client.default_job_creation_mode:
497
+ request_body["jobCreationMode"] = client.default_job_creation_mode
506
498
 
507
499
  def do_query():
508
500
  request_body["requestId"] = make_job_id()
@@ -508,31 +508,37 @@ def dataframe_to_bq_schema(dataframe, bq_schema):
508
508
  bq_schema_unused = set()
509
509
 
510
510
  bq_schema_out = []
511
- unknown_type_fields = []
512
-
511
+ unknown_type_columns = []
512
+ dataframe_reset_index = dataframe.reset_index()
513
513
  for column, dtype in list_columns_and_indexes(dataframe):
514
- # Use provided type from schema, if present.
514
+ # Step 1: use provided type from schema, if present.
515
515
  bq_field = bq_schema_index.get(column)
516
516
  if bq_field:
517
517
  bq_schema_out.append(bq_field)
518
518
  bq_schema_unused.discard(bq_field.name)
519
519
  continue
520
520
 
521
- # Otherwise, try to automatically determine the type based on the
521
+ # Step 2: try to automatically determine the type based on the
522
522
  # pandas dtype.
523
523
  bq_type = _PANDAS_DTYPE_TO_BQ.get(dtype.name)
524
524
  if bq_type is None:
525
- sample_data = _first_valid(dataframe.reset_index()[column])
525
+ sample_data = _first_valid(dataframe_reset_index[column])
526
526
  if (
527
527
  isinstance(sample_data, _BaseGeometry)
528
528
  and sample_data is not None # Paranoia
529
529
  ):
530
530
  bq_type = "GEOGRAPHY"
531
- bq_field = schema.SchemaField(column, bq_type)
532
- bq_schema_out.append(bq_field)
531
+ if bq_type is not None:
532
+ bq_schema_out.append(schema.SchemaField(column, bq_type))
533
+ continue
534
+
535
+ # Step 3: try with pyarrow if available
536
+ bq_field = _get_schema_by_pyarrow(column, dataframe_reset_index[column])
537
+ if bq_field is not None:
538
+ bq_schema_out.append(bq_field)
539
+ continue
533
540
 
534
- if bq_field.field_type is None:
535
- unknown_type_fields.append(bq_field)
541
+ unknown_type_columns.append(column)
536
542
 
537
543
  # Catch any schema mismatch. The developer explicitly asked to serialize a
538
544
  # column, but it was not found.
@@ -543,98 +549,70 @@ def dataframe_to_bq_schema(dataframe, bq_schema):
543
549
  )
544
550
  )
545
551
 
546
- # If schema detection was not successful for all columns, also try with
547
- # pyarrow, if available.
548
- if unknown_type_fields:
549
- if not pyarrow:
550
- msg = "Could not determine the type of columns: {}".format(
551
- ", ".join(field.name for field in unknown_type_fields)
552
- )
553
- warnings.warn(msg)
554
- return None # We cannot detect the schema in full.
555
-
556
- # The augment_schema() helper itself will also issue unknown type
557
- # warnings if detection still fails for any of the fields.
558
- bq_schema_out = augment_schema(dataframe, bq_schema_out)
552
+ if unknown_type_columns != []:
553
+ msg = "Could not determine the type of columns: {}".format(
554
+ ", ".join(unknown_type_columns)
555
+ )
556
+ warnings.warn(msg)
557
+ return None # We cannot detect the schema in full.
559
558
 
560
- return tuple(bq_schema_out) if bq_schema_out else None
559
+ return tuple(bq_schema_out)
561
560
 
562
561
 
563
- def augment_schema(dataframe, current_bq_schema):
564
- """Try to deduce the unknown field types and return an improved schema.
562
+ def _get_schema_by_pyarrow(name, series):
563
+ """Attempt to detect the type of the given series by leveraging PyArrow's
564
+ type detection capabilities.
565
565
 
566
- This function requires ``pyarrow`` to run. If all the missing types still
567
- cannot be detected, ``None`` is returned. If all types are already known,
568
- a shallow copy of the given schema is returned.
566
+ This function requires the ``pyarrow`` library to be installed and
567
+ available. If the series type cannot be determined or ``pyarrow`` is not
568
+ available, ``None`` is returned.
569
569
 
570
570
  Args:
571
- dataframe (pandas.DataFrame):
572
- DataFrame for which some of the field types are still unknown.
573
- current_bq_schema (Sequence[google.cloud.bigquery.schema.SchemaField]):
574
- A BigQuery schema for ``dataframe``. The types of some or all of
575
- the fields may be ``None``.
571
+ name (str):
572
+ the column name of the SchemaField.
573
+ series (pandas.Series):
574
+ The Series data for which to detect the data type.
576
575
  Returns:
577
- Optional[Sequence[google.cloud.bigquery.schema.SchemaField]]
576
+ Optional[google.cloud.bigquery.schema.SchemaField]:
577
+ A tuple containing the BigQuery-compatible type string (e.g.,
578
+ "STRING", "INTEGER", "TIMESTAMP", "DATETIME", "NUMERIC", "BIGNUMERIC")
579
+ and the mode string ("NULLABLE", "REPEATED").
580
+ Returns ``None`` if the type cannot be determined or ``pyarrow``
581
+ is not imported.
578
582
  """
579
- # pytype: disable=attribute-error
580
- augmented_schema = []
581
- unknown_type_fields = []
582
- for field in current_bq_schema:
583
- if field.field_type is not None:
584
- augmented_schema.append(field)
585
- continue
586
-
587
- arrow_table = pyarrow.array(dataframe.reset_index()[field.name])
588
-
589
- if pyarrow.types.is_list(arrow_table.type):
590
- # `pyarrow.ListType`
591
- detected_mode = "REPEATED"
592
- detected_type = _pyarrow_helpers.arrow_scalar_ids_to_bq(
593
- arrow_table.values.type.id
594
- )
595
-
596
- # For timezone-naive datetimes, pyarrow assumes the UTC timezone and adds
597
- # it to such datetimes, causing them to be recognized as TIMESTAMP type.
598
- # We thus additionally check the actual data to see if we need to overrule
599
- # that and choose DATETIME instead.
600
- # Note that this should only be needed for datetime values inside a list,
601
- # since scalar datetime values have a proper Pandas dtype that allows
602
- # distinguishing between timezone-naive and timezone-aware values before
603
- # even requiring the additional schema augment logic in this method.
604
- if detected_type == "TIMESTAMP":
605
- valid_item = _first_array_valid(dataframe[field.name])
606
- if isinstance(valid_item, datetime) and valid_item.tzinfo is None:
607
- detected_type = "DATETIME"
608
- else:
609
- detected_mode = field.mode
610
- detected_type = _pyarrow_helpers.arrow_scalar_ids_to_bq(arrow_table.type.id)
611
- if detected_type == "NUMERIC" and arrow_table.type.scale > 9:
612
- detected_type = "BIGNUMERIC"
613
583
 
614
- if detected_type is None:
615
- unknown_type_fields.append(field)
616
- continue
584
+ if not pyarrow:
585
+ return None
617
586
 
618
- new_field = schema.SchemaField(
619
- name=field.name,
620
- field_type=detected_type,
621
- mode=detected_mode,
622
- description=field.description,
623
- fields=field.fields,
624
- )
625
- augmented_schema.append(new_field)
587
+ arrow_table = pyarrow.array(series)
588
+ if pyarrow.types.is_list(arrow_table.type):
589
+ # `pyarrow.ListType`
590
+ mode = "REPEATED"
591
+ type = _pyarrow_helpers.arrow_scalar_ids_to_bq(arrow_table.values.type.id)
592
+
593
+ # For timezone-naive datetimes, pyarrow assumes the UTC timezone and adds
594
+ # it to such datetimes, causing them to be recognized as TIMESTAMP type.
595
+ # We thus additionally check the actual data to see if we need to overrule
596
+ # that and choose DATETIME instead.
597
+ # Note that this should only be needed for datetime values inside a list,
598
+ # since scalar datetime values have a proper Pandas dtype that allows
599
+ # distinguishing between timezone-naive and timezone-aware values before
600
+ # even requiring the additional schema augment logic in this method.
601
+ if type == "TIMESTAMP":
602
+ valid_item = _first_array_valid(series)
603
+ if isinstance(valid_item, datetime) and valid_item.tzinfo is None:
604
+ type = "DATETIME"
605
+ else:
606
+ mode = "NULLABLE" # default mode
607
+ type = _pyarrow_helpers.arrow_scalar_ids_to_bq(arrow_table.type.id)
608
+ if type == "NUMERIC" and arrow_table.type.scale > 9:
609
+ type = "BIGNUMERIC"
626
610
 
627
- if unknown_type_fields:
628
- warnings.warn(
629
- "Pyarrow could not determine the type of columns: {}.".format(
630
- ", ".join(field.name for field in unknown_type_fields)
631
- )
632
- )
611
+ if type is not None:
612
+ return schema.SchemaField(name, type, mode)
613
+ else:
633
614
  return None
634
615
 
635
- return augmented_schema
636
- # pytype: enable=attribute-error
637
-
638
616
 
639
617
  def dataframe_to_arrow(dataframe, bq_schema):
640
618
  """Convert pandas dataframe to Arrow table, using BigQuery schema.
@@ -1166,7 +1144,7 @@ def determine_requested_streams(
1166
1144
  """
1167
1145
 
1168
1146
  if preserve_order:
1169
- # If preserve order is set, it takes precendence.
1147
+ # If preserve order is set, it takes precedence.
1170
1148
  # Limit the requested streams to 1, to ensure that order
1171
1149
  # is preserved)
1172
1150
  return 1
@@ -221,6 +221,10 @@ class Client(ClientWithProject):
221
221
  client_options (Optional[Union[google.api_core.client_options.ClientOptions, Dict]]):
222
222
  Client options used to set user options on the client. API Endpoint
223
223
  should be set through client_options.
224
+ default_job_creation_mode (Optional[str]):
225
+ Sets the default job creation mode used by query methods such as
226
+ query_and_wait(). For lightweight queries, JOB_CREATION_OPTIONAL is
227
+ generally recommended.
224
228
 
225
229
  Raises:
226
230
  google.auth.exceptions.DefaultCredentialsError:
@@ -243,6 +247,7 @@ class Client(ClientWithProject):
243
247
  client_options: Optional[
244
248
  Union[google.api_core.client_options.ClientOptions, Dict[str, Any]]
245
249
  ] = None,
250
+ default_job_creation_mode: Optional[str] = None,
246
251
  ) -> None:
247
252
  if client_options is None:
248
253
  client_options = {}
@@ -277,6 +282,7 @@ class Client(ClientWithProject):
277
282
  self._connection = Connection(self, **kw_args)
278
283
  self._location = location
279
284
  self._default_load_job_config = copy.deepcopy(default_load_job_config)
285
+ self.default_job_creation_mode = default_job_creation_mode
280
286
 
281
287
  # Use property setter so validation can run.
282
288
  self.default_query_job_config = default_query_job_config
@@ -286,6 +292,15 @@ class Client(ClientWithProject):
286
292
  """Default location for jobs / datasets / tables."""
287
293
  return self._location
288
294
 
295
+ @property
296
+ def default_job_creation_mode(self):
297
+ """Default job creation mode used for query execution."""
298
+ return self._default_job_creation_mode
299
+
300
+ @default_job_creation_mode.setter
301
+ def default_job_creation_mode(self, value: Optional[str]):
302
+ self._default_job_creation_mode = value
303
+
289
304
  @property
290
305
  def default_query_job_config(self) -> Optional[QueryJobConfig]:
291
306
  """Default ``QueryJobConfig`` or ``None``.
@@ -1389,6 +1404,7 @@ class Client(ClientWithProject):
1389
1404
  self,
1390
1405
  table: Table,
1391
1406
  fields: Sequence[str],
1407
+ autodetect_schema: bool = False,
1392
1408
  retry: retries.Retry = DEFAULT_RETRY,
1393
1409
  timeout: TimeoutType = DEFAULT_TIMEOUT,
1394
1410
  ) -> Table:
@@ -1419,6 +1435,10 @@ class Client(ClientWithProject):
1419
1435
  fields (Sequence[str]):
1420
1436
  The fields of ``table`` to change, spelled as the
1421
1437
  :class:`~google.cloud.bigquery.table.Table` properties.
1438
+ autodetect_schema (bool):
1439
+ Specifies if the schema of the table should be autodetected when
1440
+ updating the table from the underlying source. Only applicable
1441
+ for external tables.
1422
1442
  retry (Optional[google.api_core.retry.Retry]):
1423
1443
  A description of how to retry the API call.
1424
1444
  timeout (Optional[float]):
@@ -1438,12 +1458,18 @@ class Client(ClientWithProject):
1438
1458
  path = table.path
1439
1459
  span_attributes = {"path": path, "fields": fields}
1440
1460
 
1461
+ if autodetect_schema:
1462
+ query_params = {"autodetect_schema": True}
1463
+ else:
1464
+ query_params = {}
1465
+
1441
1466
  api_response = self._call_api(
1442
1467
  retry,
1443
1468
  span_name="BigQuery.updateTable",
1444
1469
  span_attributes=span_attributes,
1445
1470
  method="PATCH",
1446
1471
  path=path,
1472
+ query_params=query_params,
1447
1473
  data=partial,
1448
1474
  headers=headers,
1449
1475
  timeout=timeout,
@@ -3521,13 +3547,6 @@ class Client(ClientWithProject):
3521
3547
  ) -> RowIterator:
3522
3548
  """Run the query, wait for it to finish, and return the results.
3523
3549
 
3524
- While ``jobCreationMode=JOB_CREATION_OPTIONAL`` is in preview in the
3525
- ``jobs.query`` REST API, use the default ``jobCreationMode`` unless
3526
- the environment variable ``QUERY_PREVIEW_ENABLED=true``. After
3527
- ``jobCreationMode`` is GA, this method will always use
3528
- ``jobCreationMode=JOB_CREATION_OPTIONAL``. See:
3529
- https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query
3530
-
3531
3550
  Args:
3532
3551
  query (str):
3533
3552
  SQL query to be executed. Defaults to the standard SQL
@@ -4123,7 +4142,7 @@ class Client(ClientWithProject):
4123
4142
  rows that were affected.
4124
4143
  query (Optional[str]):
4125
4144
  The query text used.
4126
- total_bytes_processed (Optinal[int]):
4145
+ total_bytes_processed (Optional[int]):
4127
4146
  total bytes processed from job statistics, if present.
4128
4147
 
4129
4148
  Returns:
@@ -512,7 +512,7 @@ class AccessEntry(object):
512
512
  return not self == other
513
513
 
514
514
  def __repr__(self):
515
- return f"<AccessEntry: role={self.role}, {self._entity_type}={self.entity_id}>"
515
+ return f"<AccessEntry: role={self.role}, {self.entity_type}={self.entity_id}>"
516
516
 
517
517
  def _key(self):
518
518
  """A tuple key that uniquely describes this field.
@@ -531,7 +531,7 @@ class AccessEntry(object):
531
531
  properties["condition"] = condition_key
532
532
 
533
533
  prop_tup = tuple(sorted(properties.items()))
534
- return (self.role, self._entity_type, self.entity_id, prop_tup)
534
+ return (self.role, self.entity_type, self.entity_id, prop_tup)
535
535
 
536
536
  def __hash__(self):
537
537
  return hash(self._key())
@@ -407,3 +407,22 @@ class BigLakeTableFormat(object):
407
407
 
408
408
  ICEBERG = "ICEBERG"
409
409
  """Apache Iceberg format."""
410
+
411
+
412
+ class JobCreationMode(object):
413
+ """Documented values for Job Creation Mode."""
414
+
415
+ JOB_CREATION_MODE_UNSPECIFIED = "JOB_CREATION_MODE_UNSPECIFIED"
416
+ """Job creation mode is unspecified."""
417
+
418
+ JOB_CREATION_REQUIRED = "JOB_CREATION_REQUIRED"
419
+ """Job creation is always required."""
420
+
421
+ JOB_CREATION_OPTIONAL = "JOB_CREATION_OPTIONAL"
422
+ """Job creation is optional.
423
+
424
+ Returning immediate results is prioritized.
425
+ BigQuery will automatically determine if a Job needs to be created.
426
+ The conditions under which BigQuery can decide to not create a Job are
427
+ subject to change.
428
+ """
@@ -224,6 +224,26 @@ class _JobConfig(object):
224
224
  else:
225
225
  self._properties.pop("jobTimeoutMs", None)
226
226
 
227
+ @property
228
+ def reservation(self):
229
+ """str: Optional. The reservation that job would use.
230
+
231
+ User can specify a reservation to execute the job. If reservation is
232
+ not set, reservation is determined based on the rules defined by the
233
+ reservation assignments. The expected format is
234
+ projects/{project}/locations/{location}/reservations/{reservation}.
235
+
236
+ Raises:
237
+ ValueError: If ``value`` type is not None or of string type.
238
+ """
239
+ return self._properties.setdefault("reservation", None)
240
+
241
+ @reservation.setter
242
+ def reservation(self, value):
243
+ if value and not isinstance(value, str):
244
+ raise ValueError("Reservation must be None or a string.")
245
+ self._properties["reservation"] = value
246
+
227
247
  @property
228
248
  def labels(self):
229
249
  """Dict[str, str]: Labels for the job.
@@ -488,6 +508,18 @@ class _AsyncJob(google.api_core.future.polling.PollingFuture):
488
508
  """str: Location where the job runs."""
489
509
  return _helpers._get_sub_prop(self._properties, ["jobReference", "location"])
490
510
 
511
+ @property
512
+ def reservation_id(self):
513
+ """str: Name of the primary reservation assigned to this job.
514
+
515
+ Note that this could be different than reservations reported in
516
+ the reservation field if parent reservations were used to execute
517
+ this job.
518
+ """
519
+ return _helpers._get_sub_prop(
520
+ self._properties, ["statistics", "reservation_id"]
521
+ )
522
+
491
523
  def _require_client(self, client):
492
524
  """Check client or verify over-ride.
493
525
 
@@ -1529,7 +1529,7 @@ class QueryJob(_AsyncJob):
1529
1529
  a DDL query, an ``_EmptyRowIterator`` instance is returned.
1530
1530
 
1531
1531
  Raises:
1532
- google.cloud.exceptions.GoogleAPICallError:
1532
+ google.api_core.exceptions.GoogleAPICallError:
1533
1533
  If the job failed and retries aren't successful.
1534
1534
  concurrent.futures.TimeoutError:
1535
1535
  If the job did not complete in the given timeout.
@@ -2102,6 +2102,10 @@ class QueryJob(_AsyncJob):
2102
2102
  create_bqstorage_client: bool = True,
2103
2103
  max_results: Optional[int] = None,
2104
2104
  geography_column: Optional[str] = None,
2105
+ bool_dtype: Union[Any, None] = DefaultPandasDTypes.BOOL_DTYPE,
2106
+ int_dtype: Union[Any, None] = DefaultPandasDTypes.INT_DTYPE,
2107
+ float_dtype: Union[Any, None] = None,
2108
+ string_dtype: Union[Any, None] = None,
2105
2109
  ) -> "geopandas.GeoDataFrame":
2106
2110
  """Return a GeoPandas GeoDataFrame from a QueryJob
2107
2111
 
@@ -2152,6 +2156,34 @@ class QueryJob(_AsyncJob):
2152
2156
  identifies which one to use to construct a GeoPandas
2153
2157
  GeoDataFrame. This option can be ommitted if there's
2154
2158
  only one GEOGRAPHY column.
2159
+ bool_dtype (Optional[pandas.Series.dtype, None]):
2160
+ If set, indicate a pandas ExtensionDtype (e.g. ``pandas.BooleanDtype()``)
2161
+ to convert BigQuery Boolean type, instead of relying on the default
2162
+ ``pandas.BooleanDtype()``. If you explicitly set the value to ``None``,
2163
+ then the data type will be ``numpy.dtype("bool")``. BigQuery Boolean
2164
+ type can be found at:
2165
+ https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#boolean_type
2166
+ int_dtype (Optional[pandas.Series.dtype, None]):
2167
+ If set, indicate a pandas ExtensionDtype (e.g. ``pandas.Int64Dtype()``)
2168
+ to convert BigQuery Integer types, instead of relying on the default
2169
+ ``pandas.Int64Dtype()``. If you explicitly set the value to ``None``,
2170
+ then the data type will be ``numpy.dtype("int64")``. A list of BigQuery
2171
+ Integer types can be found at:
2172
+ https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#integer_types
2173
+ float_dtype (Optional[pandas.Series.dtype, None]):
2174
+ If set, indicate a pandas ExtensionDtype (e.g. ``pandas.Float32Dtype()``)
2175
+ to convert BigQuery Float type, instead of relying on the default
2176
+ ``numpy.dtype("float64")``. If you explicitly set the value to ``None``,
2177
+ then the data type will be ``numpy.dtype("float64")``. BigQuery Float
2178
+ type can be found at:
2179
+ https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#floating_point_types
2180
+ string_dtype (Optional[pandas.Series.dtype, None]):
2181
+ If set, indicate a pandas ExtensionDtype (e.g. ``pandas.StringDtype()``) to
2182
+ convert BigQuery String type, instead of relying on the default
2183
+ ``numpy.dtype("object")``. If you explicitly set the value to ``None``,
2184
+ then the data type will be ``numpy.dtype("object")``. BigQuery String
2185
+ type can be found at:
2186
+ https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#string_type
2155
2187
 
2156
2188
  Returns:
2157
2189
  geopandas.GeoDataFrame:
@@ -2175,6 +2207,10 @@ class QueryJob(_AsyncJob):
2175
2207
  progress_bar_type=progress_bar_type,
2176
2208
  create_bqstorage_client=create_bqstorage_client,
2177
2209
  geography_column=geography_column,
2210
+ bool_dtype=bool_dtype,
2211
+ int_dtype=int_dtype,
2212
+ float_dtype=float_dtype,
2213
+ string_dtype=string_dtype,
2178
2214
  )
2179
2215
 
2180
2216
  def __iter__(self):
@@ -284,15 +284,13 @@ class SchemaField(object):
284
284
  return self._properties.get("name", "")
285
285
 
286
286
  @property
287
- def field_type(self):
287
+ def field_type(self) -> str:
288
288
  """str: The type of the field.
289
289
 
290
290
  See:
291
291
  https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableFieldSchema.FIELDS.type
292
292
  """
293
293
  type_ = self._properties.get("type")
294
- if type_ is None: # Shouldn't happen, but some unit tests do this.
295
- return None
296
294
  return cast(str, type_).upper()
297
295
 
298
296
  @property
@@ -397,20 +395,16 @@ class SchemaField(object):
397
395
  Returns:
398
396
  Tuple: The contents of this :class:`~google.cloud.bigquery.schema.SchemaField`.
399
397
  """
400
- field_type = self.field_type.upper() if self.field_type is not None else None
401
-
402
- # Type can temporarily be set to None if the code needs a SchemaField instance,
403
- # but has not determined the exact type of the field yet.
404
- if field_type is not None:
405
- if field_type == "STRING" or field_type == "BYTES":
406
- if self.max_length is not None:
407
- field_type = f"{field_type}({self.max_length})"
408
- elif field_type.endswith("NUMERIC"):
409
- if self.precision is not None:
410
- if self.scale is not None:
411
- field_type = f"{field_type}({self.precision}, {self.scale})"
412
- else:
413
- field_type = f"{field_type}({self.precision})"
398
+ field_type = self.field_type
399
+ if field_type == "STRING" or field_type == "BYTES":
400
+ if self.max_length is not None:
401
+ field_type = f"{field_type}({self.max_length})"
402
+ elif field_type.endswith("NUMERIC"):
403
+ if self.precision is not None:
404
+ if self.scale is not None:
405
+ field_type = f"{field_type}({self.precision}, {self.scale})"
406
+ else:
407
+ field_type = f"{field_type}({self.precision})"
414
408
 
415
409
  policy_tags = (
416
410
  None if self.policy_tags is None else tuple(sorted(self.policy_tags.names))