google-cloud-bigquery 3.46.1__tar.gz → 3.46.2__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 (170) hide show
  1. {google_cloud_bigquery-3.46.1/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.46.2}/PKG-INFO +1 -1
  2. google_cloud_bigquery-3.46.2/google/cloud/bigquery/_arrow_query.py +125 -0
  3. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/external_config.py +4 -4
  4. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/table.py +19 -116
  5. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/version.py +1 -1
  6. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2/google_cloud_bigquery.egg-info}/PKG-INFO +1 -1
  7. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google_cloud_bigquery.egg-info/SOURCES.txt +1 -0
  8. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_query.py +53 -0
  9. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_external_config.py +17 -0
  10. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_query_results_format_arrow.py +7 -7
  11. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_table.py +23 -18
  12. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/LICENSE +0 -0
  13. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/MANIFEST.in +0 -0
  14. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/README.rst +0 -0
  15. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/__init__.py +0 -0
  16. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_helpers.py +0 -0
  17. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_http.py +0 -0
  18. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_job_helpers.py +0 -0
  19. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_pandas_helpers.py +0 -0
  20. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
  21. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_string_references.py +0 -0
  22. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
  23. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/_versions_helpers.py +0 -0
  24. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/client.py +0 -0
  25. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/dataset.py +0 -0
  26. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/dbapi/__init__.py +0 -0
  27. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
  28. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/dbapi/connection.py +0 -0
  29. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/dbapi/cursor.py +0 -0
  30. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
  31. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/dbapi/types.py +0 -0
  32. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/encryption_configuration.py +0 -0
  33. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/enums.py +0 -0
  34. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/exceptions.py +0 -0
  35. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/format_options.py +0 -0
  36. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/iam.py +0 -0
  37. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/job/__init__.py +0 -0
  38. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/job/base.py +0 -0
  39. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/job/copy_.py +0 -0
  40. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/job/extract.py +0 -0
  41. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/job/load.py +0 -0
  42. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/job/query.py +0 -0
  43. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/magics/__init__.py +0 -0
  44. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
  45. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
  46. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
  47. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
  48. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
  49. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/magics/magics.py +0 -0
  50. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/model.py +0 -0
  51. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
  52. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/py.typed +0 -0
  53. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/query.py +0 -0
  54. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/retry.py +0 -0
  55. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/routine/__init__.py +0 -0
  56. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/routine/routine.py +0 -0
  57. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/schema.py +0 -0
  58. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery/standard_sql.py +0 -0
  59. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery_v2/__init__.py +0 -0
  60. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery_v2/types/__init__.py +0 -0
  61. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
  62. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery_v2/types/model.py +0 -0
  63. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
  64. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
  65. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
  66. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
  67. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google_cloud_bigquery.egg-info/requires.txt +0 -0
  68. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
  69. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/pyproject.toml +0 -0
  70. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/setup.cfg +0 -0
  71. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/setup.py +0 -0
  72. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/__init__.py +0 -0
  73. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/characters.json +0 -0
  74. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/characters.jsonl +0 -0
  75. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/colors.avro +0 -0
  76. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/numeric_38_12.parquet +0 -0
  77. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/people.csv +0 -0
  78. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/pico.csv +0 -0
  79. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/pico_schema.json +0 -0
  80. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/scalars.csv +0 -0
  81. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/scalars.jsonl +0 -0
  82. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/scalars_extreme.jsonl +0 -0
  83. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/scalars_schema.json +0 -0
  84. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/scalars_schema_csv.json +0 -0
  85. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/data/schema.json +0 -0
  86. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/scrub_datasets.py +0 -0
  87. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/__init__.py +0 -0
  88. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/conftest.py +0 -0
  89. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/helpers.py +0 -0
  90. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_arrow.py +0 -0
  91. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_client.py +0 -0
  92. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_job_retry.py +0 -0
  93. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_list_rows.py +0 -0
  94. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_magics.py +0 -0
  95. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_pandas.py +0 -0
  96. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_query.py +0 -0
  97. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_ssl_retry.py +0 -0
  98. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/system/test_structs.py +0 -0
  99. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/__init__.py +0 -0
  100. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/_helpers/__init__.py +0 -0
  101. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/_helpers/test_cell_data_parser.py +0 -0
  102. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/_helpers/test_data_frame_cell_data_parser.py +0 -0
  103. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/_helpers/test_scalar_query_param_parser.py +0 -0
  104. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/conftest.py +0 -0
  105. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/helpers.py +0 -0
  106. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/__init__.py +0 -0
  107. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/helpers.py +0 -0
  108. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_async_job_retry.py +0 -0
  109. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_base.py +0 -0
  110. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_copy.py +0 -0
  111. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_extract.py +0 -0
  112. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_load.py +0 -0
  113. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_load_config.py +0 -0
  114. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_query_config.py +0 -0
  115. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_query_job_retry.py +0 -0
  116. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_query_pandas.py +0 -0
  117. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/job/test_query_stats.py +0 -0
  118. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/line_arg_parser/__init__.py +0 -0
  119. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/line_arg_parser/test_lexer.py +0 -0
  120. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/line_arg_parser/test_parser.py +0 -0
  121. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/line_arg_parser/test_visitors.py +0 -0
  122. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/model/__init__.py +0 -0
  123. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/model/test_model.py +0 -0
  124. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/model/test_model_reference.py +0 -0
  125. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/routine/__init__.py +0 -0
  126. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/routine/test_external_runtime_options.py +0 -0
  127. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/routine/test_remote_function_options.py +0 -0
  128. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/routine/test_routine.py +0 -0
  129. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/routine/test_routine_argument.py +0 -0
  130. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/routine/test_routine_reference.py +0 -0
  131. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test__helpers.py +0 -0
  132. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test__http.py +0 -0
  133. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test__job_helpers.py +0 -0
  134. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test__job_helpers_retry.py +0 -0
  135. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test__pandas_helpers.py +0 -0
  136. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test__pyarrow_helpers.py +0 -0
  137. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test__versions_helpers.py +0 -0
  138. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_client.py +0 -0
  139. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_client_bigframes.py +0 -0
  140. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_client_resumable_media_upload.py +0 -0
  141. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_client_retry.py +0 -0
  142. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_create_dataset.py +0 -0
  143. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_dataset.py +0 -0
  144. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_dbapi__helpers.py +0 -0
  145. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_dbapi_connection.py +0 -0
  146. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_dbapi_cursor.py +0 -0
  147. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_dbapi_types.py +0 -0
  148. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_delete_dataset.py +0 -0
  149. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_docs.py +0 -0
  150. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_encryption_configuration.py +0 -0
  151. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_format_options.py +0 -0
  152. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_job_retry.py +0 -0
  153. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_legacy_types.py +0 -0
  154. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_list_datasets.py +0 -0
  155. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_list_jobs.py +0 -0
  156. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_list_models.py +0 -0
  157. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_list_projects.py +0 -0
  158. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_list_routines.py +0 -0
  159. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_list_tables.py +0 -0
  160. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_magics.py +0 -0
  161. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_opentelemetry_tracing.py +0 -0
  162. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_packaging.py +0 -0
  163. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_query.py +0 -0
  164. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_retry.py +0 -0
  165. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_schema.py +0 -0
  166. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_signature_compatibility.py +0 -0
  167. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_standard_sql_types.py +0 -0
  168. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_string_references.py +0 -0
  169. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_table_arrow.py +0 -0
  170. {google_cloud_bigquery-3.46.1 → google_cloud_bigquery-3.46.2}/tests/unit/test_table_pandas.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-bigquery
3
- Version: 3.46.1
3
+ Version: 3.46.2
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
@@ -0,0 +1,125 @@
1
+ # Copyright 2026 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
+ """Read query results returned in Apache Arrow format."""
16
+
17
+ from __future__ import annotations
18
+
19
+ import base64
20
+ from typing import Iterator, Optional, TYPE_CHECKING
21
+
22
+ try:
23
+ import pyarrow # type: ignore
24
+ except ImportError:
25
+ pyarrow = None # type: ignore[assignment]
26
+
27
+ if TYPE_CHECKING: # pragma: NO COVER
28
+ from google.cloud import bigquery_storage
29
+ from google.cloud.bigquery.table import RowIterator
30
+
31
+ _NO_PYARROW_ERROR = (
32
+ "The pyarrow library is not installed, please install "
33
+ "pyarrow to use the to_arrow() function."
34
+ )
35
+
36
+
37
+ def download_arrow_from_job(
38
+ row_iterator: "RowIterator",
39
+ bqstorage_client: Optional["bigquery_storage.BigQueryReadClient"] = None,
40
+ timeout: Optional[float] = None,
41
+ ) -> Iterator["pyarrow.RecordBatch"]:
42
+ """Yield Arrow record batches for ``row_iterator``'s ARROW query results.
43
+
44
+ See :meth:`google.cloud.bigquery.table.RowIterator._download_arrow_from_job_id`.
45
+ """
46
+ if pyarrow is None:
47
+ raise ValueError(_NO_PYARROW_ERROR)
48
+
49
+ # Step 1: Ensure BigQuery Read API client is available upfront.
50
+ if bqstorage_client is None:
51
+ if row_iterator.client is None:
52
+ raise ValueError("RowIterator client is None.")
53
+ bqstorage_client = row_iterator.client._ensure_bqstorage_client()
54
+ if bqstorage_client is None:
55
+ raise ValueError(
56
+ "The google-cloud-bigquery-storage library is required to read Arrow results."
57
+ )
58
+
59
+ offset = 0
60
+ pa_schema = None
61
+ total_rows = row_iterator.total_rows
62
+ job_complete = False
63
+
64
+ # Step 2: Process initial inline Arrow response from jobs.query if available.
65
+ if row_iterator._first_page_response:
66
+ first_page = row_iterator._first_page_response
67
+ row_iterator._first_page_response = None
68
+
69
+ job_complete = bool(first_page.get("jobComplete", False))
70
+ if job_complete:
71
+ total_rows = int(first_page.get("totalRows", 0))
72
+
73
+ arrow_schema_json = first_page.get("arrowSchema")
74
+ if isinstance(arrow_schema_json, dict):
75
+ schema_bytes = arrow_schema_json.get("serializedSchema")
76
+ if schema_bytes:
77
+ if isinstance(schema_bytes, str):
78
+ schema_bytes = base64.b64decode(schema_bytes)
79
+ pa_schema = pyarrow.ipc.read_schema(pyarrow.py_buffer(schema_bytes))
80
+
81
+ arrow_batch_json = first_page.get("arrowRecordBatch")
82
+ if isinstance(arrow_batch_json, dict) and pa_schema is not None:
83
+ batch_bytes = arrow_batch_json.get("serializedRecordBatch")
84
+ if batch_bytes:
85
+ if isinstance(batch_bytes, str):
86
+ batch_bytes = base64.b64decode(batch_bytes)
87
+ batch = pyarrow.ipc.read_record_batch(
88
+ pyarrow.py_buffer(batch_bytes),
89
+ pa_schema,
90
+ )
91
+ offset += batch.num_rows
92
+ yield batch
93
+
94
+ # Step 3: Return early if all results were delivered in the first page response.
95
+ if job_complete and offset >= total_rows:
96
+ return
97
+
98
+ # Step 4: Stream remaining Arrow record batches from the job default stream.
99
+ project = row_iterator._project or (
100
+ row_iterator.client.project if row_iterator.client else None
101
+ )
102
+ location = row_iterator._location or (
103
+ row_iterator.client.location if row_iterator.client else None
104
+ )
105
+ stream_name = f"projects/{project}/locations/{location}/jobs/{row_iterator._job_id}/streams/_default"
106
+ reader = bqstorage_client.read_rows(stream_name, offset=offset, timeout=timeout)
107
+ for response in reader:
108
+ if (
109
+ response.arrow_schema
110
+ and response.arrow_schema.serialized_schema
111
+ and pa_schema is None
112
+ ):
113
+ pa_schema = pyarrow.ipc.read_schema(
114
+ pyarrow.py_buffer(response.arrow_schema.serialized_schema)
115
+ )
116
+ if (
117
+ response.arrow_record_batch
118
+ and response.arrow_record_batch.serialized_record_batch
119
+ and pa_schema is not None
120
+ ):
121
+ batch = pyarrow.ipc.read_record_batch(
122
+ pyarrow.py_buffer(response.arrow_record_batch.serialized_record_batch),
123
+ pa_schema,
124
+ )
125
+ yield batch
@@ -729,14 +729,14 @@ class ExternalConfig(object):
729
729
  self._properties = {"sourceFormat": source_format}
730
730
 
731
731
  @property
732
- def source_format(self):
733
- """:class:`~.external_config.ExternalSourceFormat`:
732
+ def source_format(self) -> Optional[str]:
733
+ """Optional[:class:`~.external_config.ExternalSourceFormat`]:
734
734
  Format of external source.
735
735
 
736
736
  See
737
737
  https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ExternalDataConfiguration.FIELDS.source_format
738
738
  """
739
- return self._properties["sourceFormat"]
739
+ return self._properties.get("sourceFormat")
740
740
 
741
741
  @property
742
742
  def options(self) -> Optional[OptionsType]:
@@ -1120,7 +1120,7 @@ class ExternalConfig(object):
1120
1120
  Returns:
1121
1121
  ExternalConfig: Configuration parsed from ``resource``.
1122
1122
  """
1123
- config = cls(resource["sourceFormat"])
1123
+ config = cls(resource.get("sourceFormat"))
1124
1124
  config._properties = copy.deepcopy(resource)
1125
1125
  return config
1126
1126
 
@@ -16,7 +16,6 @@
16
16
 
17
17
  from __future__ import absolute_import
18
18
 
19
- import base64
20
19
  import copy
21
20
  import datetime
22
21
  import functools
@@ -59,6 +58,7 @@ import google.api_core.exceptions
59
58
  import google.cloud._helpers # type: ignore
60
59
  from google.api_core.page_iterator import HTTPIterator
61
60
  from google.cloud.bigquery import (
61
+ _arrow_query,
62
62
  _helpers,
63
63
  _pandas_helpers,
64
64
  _string_references,
@@ -118,12 +118,6 @@ _TO_DATAFRAME_DEPRECATED = (
118
118
  "For direct, optimized access, please call 'pandas_gbq.read_gbq()' directly."
119
119
  )
120
120
 
121
- _TO_ARROW_DEPRECATED = (
122
- "Retrieving PyArrow Tables via google-cloud-bigquery is deprecated. "
123
- "For direct, optimized access, please call 'pandas_gbq.arrow.read_bigquery_table()' "
124
- "or 'pandas_gbq.arrow.read_bigquery_query()' directly."
125
- )
126
-
127
121
  _CANNOT_ITERATE_ARROW_ERROR = (
128
122
  "Cannot iterate over non-arrow results when queryResultsFormat is ARROW. "
129
123
  "Use to_arrow_iterable() or to_arrow() instead."
@@ -2158,15 +2152,16 @@ class RowIterator(HTTPIterator):
2158
2152
 
2159
2153
  params = self._get_query_params()
2160
2154
 
2161
- # If the user has provided page_size and start_index, we need to pass
2162
- # start_index for the first page, but for all subsequent pages, we
2163
- # should not pass start_index. We make a shallow copy of params and do
2164
- # not alter the original, so if the user iterates the results again,
2165
- # start_index is preserved.
2155
+ # If the user has provided start_index, we need to pass it for the
2156
+ # first page, but once the server hands back a page token we should
2157
+ # not pass start_index, because the server only allows one of them.
2158
+ # This applies whether the pages come from page_size or from the
2159
+ # server splitting a large result. We make a shallow copy of params
2160
+ # and do not alter the original, so if the user iterates the results
2161
+ # again, start_index is preserved.
2166
2162
  params_copy = copy.copy(params)
2167
- if self._page_size is not None:
2168
- if self.page_number and "startIndex" in params:
2169
- del params_copy["startIndex"]
2163
+ if self.next_page_token is not None and "startIndex" in params:
2164
+ del params_copy["startIndex"]
2170
2165
 
2171
2166
  return self.api_request(
2172
2167
  method=self._HTTP_METHOD, path=self.path, query_params=params_copy
@@ -2324,84 +2319,9 @@ class RowIterator(HTTPIterator):
2324
2319
  Yields:
2325
2320
  pyarrow.RecordBatch: Record batches generated from the query result.
2326
2321
  """
2327
- if pyarrow is None:
2328
- raise ValueError(_NO_PYARROW_ERROR)
2329
-
2330
- # Step 1: Ensure BigQuery Read API client is available upfront.
2331
- if bqstorage_client is None:
2332
- if self.client is None:
2333
- raise ValueError("RowIterator client is None.")
2334
- bqstorage_client = self.client._ensure_bqstorage_client()
2335
- if bqstorage_client is None:
2336
- raise ValueError(
2337
- "The google-cloud-bigquery-storage library is required to read Arrow results."
2338
- )
2339
-
2340
- offset = 0
2341
- pa_schema = None
2342
- total_rows = self.total_rows
2343
- job_complete = False
2344
-
2345
- # Step 2: Process initial inline Arrow response from jobs.query if available.
2346
- if self._first_page_response:
2347
- first_page = self._first_page_response
2348
- self._first_page_response = None
2349
-
2350
- job_complete = bool(first_page.get("jobComplete", False))
2351
- if job_complete:
2352
- total_rows = int(first_page.get("totalRows", 0))
2353
-
2354
- arrow_schema_json = first_page.get("arrowSchema")
2355
- if isinstance(arrow_schema_json, dict):
2356
- schema_bytes = arrow_schema_json.get("serializedSchema")
2357
- if schema_bytes:
2358
- if isinstance(schema_bytes, str):
2359
- schema_bytes = base64.b64decode(schema_bytes)
2360
- pa_schema = pyarrow.ipc.read_schema(pyarrow.py_buffer(schema_bytes))
2361
-
2362
- arrow_batch_json = first_page.get("arrowRecordBatch")
2363
- if isinstance(arrow_batch_json, dict) and pa_schema is not None:
2364
- batch_bytes = arrow_batch_json.get("serializedRecordBatch")
2365
- if batch_bytes:
2366
- if isinstance(batch_bytes, str):
2367
- batch_bytes = base64.b64decode(batch_bytes)
2368
- batch = pyarrow.ipc.read_record_batch(
2369
- pyarrow.py_buffer(batch_bytes),
2370
- pa_schema,
2371
- )
2372
- offset += batch.num_rows
2373
- yield batch
2374
-
2375
- # Step 3: Return early if all results were delivered in the first page response.
2376
- if job_complete and offset >= total_rows:
2377
- return
2378
-
2379
- # Step 4: Stream remaining Arrow record batches from the job default stream.
2380
- project = self._project or (self.client.project if self.client else None)
2381
- location = self._location or (self.client.location if self.client else None)
2382
- stream_name = f"projects/{project}/locations/{location}/jobs/{self._job_id}/streams/_default"
2383
- reader = bqstorage_client.read_rows(stream_name, offset=offset, timeout=timeout)
2384
- for response in reader:
2385
- if (
2386
- response.arrow_schema
2387
- and response.arrow_schema.serialized_schema
2388
- and pa_schema is None
2389
- ):
2390
- pa_schema = pyarrow.ipc.read_schema(
2391
- pyarrow.py_buffer(response.arrow_schema.serialized_schema)
2392
- )
2393
- if (
2394
- response.arrow_record_batch
2395
- and response.arrow_record_batch.serialized_record_batch
2396
- and pa_schema is not None
2397
- ):
2398
- batch = pyarrow.ipc.read_record_batch(
2399
- pyarrow.py_buffer(
2400
- response.arrow_record_batch.serialized_record_batch
2401
- ),
2402
- pa_schema,
2403
- )
2404
- yield batch
2322
+ return _arrow_query.download_arrow_from_job(
2323
+ self, bqstorage_client=bqstorage_client, timeout=timeout
2324
+ )
2405
2325
 
2406
2326
  # If changing the signature of this method, make sure to apply the same
2407
2327
  # changes to job.QueryJob.to_arrow()
@@ -2468,12 +2388,6 @@ class RowIterator(HTTPIterator):
2468
2388
 
2469
2389
  .. versionadded:: 1.17.0
2470
2390
  """
2471
- warnings.warn(
2472
- _TO_ARROW_DEPRECATED,
2473
- PendingDeprecationWarning,
2474
- stacklevel=2,
2475
- )
2476
-
2477
2391
  if pyarrow is None:
2478
2392
  raise ValueError(_NO_PYARROW_ERROR)
2479
2393
 
@@ -2991,18 +2905,12 @@ class RowIterator(HTTPIterator):
2991
2905
  create_bqstorage_client = False
2992
2906
  bqstorage_client = None
2993
2907
 
2994
- with warnings.catch_warnings():
2995
- warnings.filterwarnings(
2996
- "ignore",
2997
- category=PendingDeprecationWarning,
2998
- message="Retrieving PyArrow Tables.*",
2999
- )
3000
- record_batch = self.to_arrow(
3001
- progress_bar_type=progress_bar_type,
3002
- bqstorage_client=bqstorage_client,
3003
- create_bqstorage_client=create_bqstorage_client,
3004
- timeout=timeout,
3005
- )
2908
+ record_batch = self.to_arrow(
2909
+ progress_bar_type=progress_bar_type,
2910
+ bqstorage_client=bqstorage_client,
2911
+ create_bqstorage_client=create_bqstorage_client,
2912
+ timeout=timeout,
2913
+ )
3006
2914
 
3007
2915
  # Default date dtype is `db_dtypes.DateDtype()` that could cause out of bounds error,
3008
2916
  # when pyarrow converts date values to nanosecond precision. To avoid the error, we
@@ -3278,11 +3186,6 @@ class _EmptyRowIterator(RowIterator):
3278
3186
  """
3279
3187
  if pyarrow is None:
3280
3188
  raise ValueError(_NO_PYARROW_ERROR)
3281
- warnings.warn(
3282
- _TO_ARROW_DEPRECATED,
3283
- PendingDeprecationWarning,
3284
- stacklevel=2,
3285
- )
3286
3189
  return pyarrow.Table.from_arrays(())
3287
3190
 
3288
3191
  def to_dataframe(
@@ -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.46.1"
15
+ __version__ = "3.46.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-bigquery
3
- Version: 3.46.1
3
+ Version: 3.46.2
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
@@ -5,6 +5,7 @@ pyproject.toml
5
5
  setup.cfg
6
6
  setup.py
7
7
  google/cloud/bigquery/__init__.py
8
+ google/cloud/bigquery/_arrow_query.py
8
9
  google/cloud/bigquery/_helpers.py
9
10
  google/cloud/bigquery/_http.py
10
11
  google/cloud/bigquery/_job_helpers.py
@@ -1632,6 +1632,59 @@ class TestQueryJob(_Base):
1632
1632
  tabledata_list_request_2[1]["query_params"]["maxResults"], page_size
1633
1633
  )
1634
1634
 
1635
+ def test_result_with_start_index_and_max_results_multi_page(self):
1636
+ # When only max_results and start_index are set, the server may still
1637
+ # split the result into several pages (e.g. when a page would exceed
1638
+ # the response size limit). The follow-up requests carry a page token,
1639
+ # so they must not carry start_index as well, because the server only
1640
+ # allows one of them.
1641
+ query_resource = {
1642
+ "jobComplete": True,
1643
+ "jobReference": {"projectId": self.PROJECT, "jobId": self.JOB_ID},
1644
+ "schema": {"fields": [{"name": "col1", "type": "STRING"}]},
1645
+ "totalRows": "7",
1646
+ }
1647
+ tabledata_resource_1 = {
1648
+ "totalRows": "7",
1649
+ "pageToken": "page_token_1",
1650
+ "rows": [
1651
+ {"f": [{"v": "abc"}]},
1652
+ {"f": [{"v": "def"}]},
1653
+ ],
1654
+ }
1655
+ tabledata_resource_2 = {
1656
+ "totalRows": "7",
1657
+ "rows": [
1658
+ {"f": [{"v": "ghi"}]},
1659
+ {"f": [{"v": "jkl"}]},
1660
+ ],
1661
+ }
1662
+
1663
+ connection = make_connection(
1664
+ query_resource, tabledata_resource_1, tabledata_resource_2
1665
+ )
1666
+ client = _make_client(self.PROJECT, connection=connection)
1667
+ resource = self._make_resource(ended=True)
1668
+ job = self._get_target_class().from_api_repr(resource, client)
1669
+
1670
+ start_index = 1
1671
+ max_results = 4
1672
+
1673
+ rows = list(job.result(max_results=max_results, start_index=start_index))
1674
+
1675
+ self.assertEqual([row.col1 for row in rows], ["abc", "def", "ghi", "jkl"])
1676
+ self.assertEqual(len(connection.api_request.call_args_list), 3)
1677
+
1678
+ tabledata_list_request_1 = connection.api_request.call_args_list[1]
1679
+ self.assertEqual(
1680
+ tabledata_list_request_1[1]["query_params"]["startIndex"], start_index
1681
+ )
1682
+
1683
+ tabledata_list_request_2 = connection.api_request.call_args_list[2]
1684
+ query_params_2 = tabledata_list_request_2[1]["query_params"]
1685
+ self.assertEqual(query_params_2["pageToken"], "page_token_1")
1686
+ self.assertNotIn("startIndex", query_params_2)
1687
+
1635
1688
  def test_result_error(self):
1636
1689
  from google.cloud import exceptions
1637
1690
 
@@ -81,6 +81,23 @@ class TestExternalConfig(unittest.TestCase):
81
81
  got_resource = ec.to_api_repr()
82
82
  self.assertEqual(got_resource, resource)
83
83
 
84
+ def test_from_api_repr_missing_source_format(self):
85
+ resource = copy.deepcopy(self.BASE_RESOURCE)
86
+ del resource["sourceFormat"]
87
+
88
+ ec = external_config.ExternalConfig.from_api_repr(resource)
89
+ self._verify_base(ec)
90
+ self.assertIsNone(ec.source_format)
91
+ self.assertIsNone(ec.options)
92
+ self.assertIsNone(ec.avro_options)
93
+ self.assertIsNone(ec.bigtable_options)
94
+ self.assertIsNone(ec.csv_options)
95
+ self.assertIsNone(ec.google_sheets_options)
96
+ self.assertIsNone(ec.parquet_options)
97
+
98
+ got_resource = ec.to_api_repr()
99
+ self.assertEqual(got_resource, resource)
100
+
84
101
  def test_to_api_repr_base(self):
85
102
  ec = external_config.ExternalConfig("")
86
103
  ec.source_uris = self.SOURCE_URIS
@@ -193,7 +193,7 @@ class TestQueryResultsFormatOption1(unittest.TestCase):
193
193
  mock_response.arrow_record_batch = None
194
194
  mock_bqstorage.read_rows.return_value = [mock_response]
195
195
 
196
- with mock.patch("google.cloud.bigquery.table.pyarrow") as mock_pyarrow:
196
+ with mock.patch("google.cloud.bigquery._arrow_query.pyarrow") as mock_pyarrow:
197
197
  mock_pyarrow.py_buffer = lambda x: x
198
198
  batches = list(iterator._download_arrow_from_job_id(timeout=5.0))
199
199
  self.assertEqual(batches, [])
@@ -247,7 +247,7 @@ class TestQueryResultsFormatOption1(unittest.TestCase):
247
247
 
248
248
  mock_bqstorage.read_rows.return_value = [mock_response]
249
249
 
250
- with mock.patch("google.cloud.bigquery.table.pyarrow") as mock_pyarrow:
250
+ with mock.patch("google.cloud.bigquery._arrow_query.pyarrow") as mock_pyarrow:
251
251
  mock_pyarrow.py_buffer = lambda x: x
252
252
  mock_pyarrow.ipc.read_schema.return_value = "deserialized_schema"
253
253
  mock_pyarrow.ipc.read_record_batch.side_effect = [
@@ -306,7 +306,7 @@ class TestQueryResultsFormatOption1(unittest.TestCase):
306
306
 
307
307
  mock_bqstorage.read_rows.return_value = [mock_response]
308
308
 
309
- with mock.patch("google.cloud.bigquery.table.pyarrow") as mock_pyarrow:
309
+ with mock.patch("google.cloud.bigquery._arrow_query.pyarrow") as mock_pyarrow:
310
310
  mock_pyarrow.py_buffer = lambda x: x
311
311
  mock_pyarrow.ipc.read_schema.return_value = "deserialized_schema"
312
312
  mock_pyarrow.ipc.read_record_batch.return_value = mock_stream_batch
@@ -339,7 +339,7 @@ class TestQueryResultsFormatOption1(unittest.TestCase):
339
339
  query_results_format="ARROW",
340
340
  )
341
341
 
342
- with mock.patch("google.cloud.bigquery.table.pyarrow"):
342
+ with mock.patch("google.cloud.bigquery._arrow_query.pyarrow"):
343
343
  with self.assertRaises(ValueError) as ctx:
344
344
  list(iterator._download_arrow_from_job_id())
345
345
  self.assertIn(
@@ -374,7 +374,7 @@ class TestQueryResultsFormatOption1(unittest.TestCase):
374
374
 
375
375
  mock_bqstorage.read_rows.return_value = [mock_response]
376
376
 
377
- with mock.patch("google.cloud.bigquery.table.pyarrow") as mock_pyarrow:
377
+ with mock.patch("google.cloud.bigquery._arrow_query.pyarrow") as mock_pyarrow:
378
378
  mock_pyarrow.py_buffer = lambda x: x
379
379
  mock_pyarrow.ipc.read_schema.return_value = "fake_schema"
380
380
  mock_pyarrow.ipc.read_record_batch.return_value = "fake_batch"
@@ -422,7 +422,7 @@ class TestQueryResultsFormatOption1(unittest.TestCase):
422
422
  mock_first_batch = mock.MagicMock()
423
423
  mock_first_batch.num_rows = 10
424
424
 
425
- with mock.patch("google.cloud.bigquery.table.pyarrow") as mock_pyarrow:
425
+ with mock.patch("google.cloud.bigquery._arrow_query.pyarrow") as mock_pyarrow:
426
426
  mock_pyarrow.py_buffer = lambda x: x
427
427
  mock_pyarrow.ipc.read_schema.return_value = "deserialized_schema"
428
428
  mock_pyarrow.ipc.read_record_batch.return_value = mock_first_batch
@@ -464,7 +464,7 @@ class TestQueryResultsFormatOption1(unittest.TestCase):
464
464
  mock_first_batch.num_rows = 10
465
465
  mock_bqstorage.read_rows.return_value = []
466
466
 
467
- with mock.patch("google.cloud.bigquery.table.pyarrow") as mock_pyarrow:
467
+ with mock.patch("google.cloud.bigquery._arrow_query.pyarrow") as mock_pyarrow:
468
468
  mock_pyarrow.py_buffer = lambda x: x
469
469
  mock_pyarrow.ipc.read_schema.return_value = "deserialized_schema"
470
470
  mock_pyarrow.ipc.read_record_batch.return_value = mock_first_batch
@@ -2508,16 +2508,21 @@ class Test_EmptyRowIterator(unittest.TestCase):
2508
2508
  else:
2509
2509
  assert not hasattr(df, "crs")
2510
2510
 
2511
- def test_to_arrow_emits_pending_deprecation_warning(self):
2511
+ def test_to_arrow_does_not_emit_deprecation_warning(self):
2512
2512
  pytest.importorskip("pyarrow")
2513
2513
  row_iterator = self._make_one()
2514
2514
 
2515
- with pytest.warns(
2516
- PendingDeprecationWarning,
2517
- match="Retrieving PyArrow Tables via google-cloud-bigquery is deprecated",
2518
- ):
2515
+ with warnings.catch_warnings(record=True) as record:
2516
+ warnings.simplefilter("always")
2519
2517
  row_iterator.to_arrow()
2520
2518
 
2519
+ deprecation_warnings = [
2520
+ w
2521
+ for w in record
2522
+ if issubclass(w.category, (PendingDeprecationWarning, DeprecationWarning))
2523
+ ]
2524
+ self.assertEqual(len(deprecation_warnings), 0)
2525
+
2521
2526
  def test_to_dataframe_emits_pending_deprecation_warning(self):
2522
2527
  pytest.importorskip("pandas")
2523
2528
  row_iterator = self._make_one()
@@ -3302,8 +3307,8 @@ class TestRowIterator(unittest.TestCase):
3302
3307
  self.assertEqual(sports, ["volleyball", "basketball"])
3303
3308
 
3304
3309
  # Expect warning from both the arrow conversion, and the json deserialization.
3305
- sport_warnings = [w for w in warned if "sport" in str(w.message)]
3306
- self.assertEqual(len(sport_warnings), 2)
3310
+ self.assertEqual(len(warned), 2)
3311
+ self.assertTrue(all("sport" in str(warning) for warning in warned))
3307
3312
 
3308
3313
  def test_to_arrow_w_empty_table(self):
3309
3314
  pytest.importorskip("numpy")
@@ -5961,16 +5966,21 @@ class TestRowIterator(unittest.TestCase):
5961
5966
 
5962
5967
  self.assertEqual([v.__class__.__name__ for v in df.g], ["Point"])
5963
5968
 
5964
- def test_to_arrow_emits_pending_deprecation_warning(self):
5969
+ def test_to_arrow_does_not_emit_deprecation_warning(self):
5965
5970
  pytest.importorskip("pyarrow")
5966
5971
  row_iterator = self._make_one_from_data((("name", "STRING"),), (("foo",),))
5967
5972
 
5968
- with pytest.warns(
5969
- PendingDeprecationWarning,
5970
- match="Retrieving PyArrow Tables via google-cloud-bigquery is deprecated",
5971
- ):
5973
+ with warnings.catch_warnings(record=True) as record:
5974
+ warnings.simplefilter("always")
5972
5975
  row_iterator.to_arrow(create_bqstorage_client=False)
5973
5976
 
5977
+ deprecation_warnings = [
5978
+ w
5979
+ for w in record
5980
+ if issubclass(w.category, (PendingDeprecationWarning, DeprecationWarning))
5981
+ ]
5982
+ self.assertEqual(len(deprecation_warnings), 0)
5983
+
5974
5984
  def test_to_dataframe_emits_pending_deprecation_warning(self):
5975
5985
  pytest.importorskip("pandas")
5976
5986
  row_iterator = self._make_one_from_data((("name", "STRING"),), (("foo",),))
@@ -5978,14 +5988,9 @@ class TestRowIterator(unittest.TestCase):
5978
5988
  with pytest.warns(
5979
5989
  PendingDeprecationWarning,
5980
5990
  match="Retrieving DataFrames via google-cloud-bigquery is deprecated",
5981
- ) as record:
5991
+ ):
5982
5992
  row_iterator.to_dataframe(create_bqstorage_client=False)
5983
5993
 
5984
- arrow_warnings = [
5985
- w for w in record if "Retrieving PyArrow Tables" in str(w.message)
5986
- ]
5987
- self.assertEqual(len(arrow_warnings), 0)
5988
-
5989
5994
  def test_to_geodataframe_does_not_emit_deprecation_warning(self):
5990
5995
  pytest.importorskip("pandas")
5991
5996
  mock_geopandas = mock.Mock()