google-cloud-bigquery 3.42.2__tar.gz → 3.42.3__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 (167) hide show
  1. {google_cloud_bigquery-3.42.2/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.42.3}/PKG-INFO +6 -8
  2. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/dbapi/connection.py +12 -3
  3. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/dbapi/cursor.py +12 -5
  4. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/version.py +1 -1
  5. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3/google_cloud_bigquery.egg-info}/PKG-INFO +6 -8
  6. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google_cloud_bigquery.egg-info/requires.txt +5 -11
  7. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/pyproject.toml +5 -7
  8. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_client.py +79 -52
  9. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_magics.py +12 -3
  10. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_async_job_retry.py +2 -3
  11. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_query_job_retry.py +3 -5
  12. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_dbapi_connection.py +30 -14
  13. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_dbapi_cursor.py +19 -16
  14. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/LICENSE +0 -0
  15. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/MANIFEST.in +0 -0
  16. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/README.rst +0 -0
  17. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/__init__.py +0 -0
  18. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_helpers.py +0 -0
  19. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_http.py +0 -0
  20. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_job_helpers.py +0 -0
  21. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_pandas_helpers.py +0 -0
  22. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
  23. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_string_references.py +0 -0
  24. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
  25. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/_versions_helpers.py +0 -0
  26. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/client.py +0 -0
  27. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/dataset.py +0 -0
  28. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/dbapi/__init__.py +0 -0
  29. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
  30. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
  31. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/dbapi/types.py +0 -0
  32. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/encryption_configuration.py +0 -0
  33. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/enums.py +0 -0
  34. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/exceptions.py +0 -0
  35. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/external_config.py +0 -0
  36. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/format_options.py +0 -0
  37. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/iam.py +0 -0
  38. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/job/__init__.py +0 -0
  39. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/job/base.py +0 -0
  40. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/job/copy_.py +0 -0
  41. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/job/extract.py +0 -0
  42. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/job/load.py +0 -0
  43. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/job/query.py +0 -0
  44. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/magics/__init__.py +0 -0
  45. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
  46. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
  47. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
  48. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
  49. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
  50. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/magics/magics.py +0 -0
  51. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/model.py +0 -0
  52. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
  53. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/py.typed +0 -0
  54. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/query.py +0 -0
  55. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/retry.py +0 -0
  56. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/routine/__init__.py +0 -0
  57. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/routine/routine.py +0 -0
  58. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/schema.py +0 -0
  59. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/standard_sql.py +0 -0
  60. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery/table.py +0 -0
  61. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery_v2/__init__.py +0 -0
  62. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery_v2/types/__init__.py +0 -0
  63. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
  64. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery_v2/types/model.py +0 -0
  65. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
  66. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
  67. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
  68. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google_cloud_bigquery.egg-info/SOURCES.txt +0 -0
  69. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
  70. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
  71. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/setup.cfg +0 -0
  72. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/setup.py +0 -0
  73. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/__init__.py +0 -0
  74. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/characters.json +0 -0
  75. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/characters.jsonl +0 -0
  76. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/colors.avro +0 -0
  77. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/numeric_38_12.parquet +0 -0
  78. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/people.csv +0 -0
  79. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/pico.csv +0 -0
  80. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/pico_schema.json +0 -0
  81. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/scalars.csv +0 -0
  82. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/scalars.jsonl +0 -0
  83. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/scalars_extreme.jsonl +0 -0
  84. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/scalars_schema.json +0 -0
  85. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/scalars_schema_csv.json +0 -0
  86. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/data/schema.json +0 -0
  87. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/scrub_datasets.py +0 -0
  88. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/__init__.py +0 -0
  89. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/conftest.py +0 -0
  90. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/helpers.py +0 -0
  91. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_arrow.py +0 -0
  92. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_job_retry.py +0 -0
  93. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_list_rows.py +0 -0
  94. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_pandas.py +0 -0
  95. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_query.py +0 -0
  96. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_ssl_retry.py +0 -0
  97. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/system/test_structs.py +0 -0
  98. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/__init__.py +0 -0
  99. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/_helpers/__init__.py +0 -0
  100. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/_helpers/test_cell_data_parser.py +0 -0
  101. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/_helpers/test_data_frame_cell_data_parser.py +0 -0
  102. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/_helpers/test_scalar_query_param_parser.py +0 -0
  103. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/conftest.py +0 -0
  104. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/helpers.py +0 -0
  105. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/__init__.py +0 -0
  106. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/helpers.py +0 -0
  107. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_base.py +0 -0
  108. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_copy.py +0 -0
  109. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_extract.py +0 -0
  110. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_load.py +0 -0
  111. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_load_config.py +0 -0
  112. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_query.py +0 -0
  113. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_query_config.py +0 -0
  114. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_query_pandas.py +0 -0
  115. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/job/test_query_stats.py +0 -0
  116. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/line_arg_parser/__init__.py +0 -0
  117. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/line_arg_parser/test_lexer.py +0 -0
  118. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/line_arg_parser/test_parser.py +0 -0
  119. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/line_arg_parser/test_visitors.py +0 -0
  120. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/model/__init__.py +0 -0
  121. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/model/test_model.py +0 -0
  122. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/model/test_model_reference.py +0 -0
  123. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/routine/__init__.py +0 -0
  124. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/routine/test_external_runtime_options.py +0 -0
  125. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/routine/test_remote_function_options.py +0 -0
  126. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/routine/test_routine.py +0 -0
  127. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/routine/test_routine_argument.py +0 -0
  128. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/routine/test_routine_reference.py +0 -0
  129. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test__helpers.py +0 -0
  130. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test__http.py +0 -0
  131. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test__job_helpers.py +0 -0
  132. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test__job_helpers_retry.py +0 -0
  133. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test__pandas_helpers.py +0 -0
  134. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test__pyarrow_helpers.py +0 -0
  135. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test__versions_helpers.py +0 -0
  136. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_client.py +0 -0
  137. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_client_bigframes.py +0 -0
  138. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_client_resumable_media_upload.py +0 -0
  139. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_client_retry.py +0 -0
  140. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_create_dataset.py +0 -0
  141. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_dataset.py +0 -0
  142. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_dbapi__helpers.py +0 -0
  143. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_dbapi_types.py +0 -0
  144. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_delete_dataset.py +0 -0
  145. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_encryption_configuration.py +0 -0
  146. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_external_config.py +0 -0
  147. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_format_options.py +0 -0
  148. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_job_retry.py +0 -0
  149. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_legacy_types.py +0 -0
  150. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_list_datasets.py +0 -0
  151. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_list_jobs.py +0 -0
  152. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_list_models.py +0 -0
  153. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_list_projects.py +0 -0
  154. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_list_routines.py +0 -0
  155. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_list_tables.py +0 -0
  156. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_magics.py +0 -0
  157. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_opentelemetry_tracing.py +0 -0
  158. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_packaging.py +0 -0
  159. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_query.py +0 -0
  160. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_retry.py +0 -0
  161. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_schema.py +0 -0
  162. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_signature_compatibility.py +0 -0
  163. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_standard_sql_types.py +0 -0
  164. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_string_references.py +0 -0
  165. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_table.py +0 -0
  166. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/tests/unit/test_table_arrow.py +0 -0
  167. {google_cloud_bigquery-3.42.2 → google_cloud_bigquery-3.42.3}/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.42.2
3
+ Version: 3.42.3
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
@@ -27,16 +27,14 @@ Requires-Dist: packaging>=24.2.0
27
27
  Requires-Dist: python-dateutil<3.0.0,>=2.8.2
28
28
  Requires-Dist: requests<3.0.0,>=2.21.0
29
29
  Provides-Extra: bqstorage
30
- Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "bqstorage"
31
- Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "bqstorage"
32
- Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version >= "3.11" and extra == "bqstorage"
30
+ Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.29.0; extra == "bqstorage"
31
+ Requires-Dist: grpcio<2.0.0,>=1.59.0; extra == "bqstorage"
33
32
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "bqstorage"
34
33
  Requires-Dist: pyarrow>=4.0.0; extra == "bqstorage"
35
34
  Provides-Extra: pandas
36
35
  Requires-Dist: pandas>=1.3.0; extra == "pandas"
37
36
  Requires-Dist: pandas-gbq>=0.26.1; extra == "pandas"
38
- Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "pandas"
39
- Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version >= "3.11" and extra == "pandas"
37
+ Requires-Dist: grpcio<2.0.0,>=1.59.0; extra == "pandas"
40
38
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "pandas"
41
39
  Requires-Dist: pyarrow>=3.0.0; extra == "pandas"
42
40
  Requires-Dist: db-dtypes<2.0.0,>=1.0.4; extra == "pandas"
@@ -58,8 +56,8 @@ Requires-Dist: opentelemetry-api>=1.1.0; extra == "opentelemetry"
58
56
  Requires-Dist: opentelemetry-sdk>=1.1.0; extra == "opentelemetry"
59
57
  Requires-Dist: opentelemetry-instrumentation>=0.20b0; extra == "opentelemetry"
60
58
  Provides-Extra: bigquery-v2
61
- Requires-Dist: proto-plus<2.0.0,>=1.22.3; extra == "bigquery-v2"
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"
59
+ Requires-Dist: proto-plus<2.0.0,>=1.26.1; extra == "bigquery-v2"
60
+ Requires-Dist: protobuf<8.0.0,>=6.33.5; extra == "bigquery-v2"
63
61
  Provides-Extra: all
64
62
  Requires-Dist: google-cloud-bigquery[bigquery_v2,bqstorage,geopandas,ipython,ipywidgets,matplotlib,opentelemetry,pandas,tqdm]; extra == "all"
65
63
  Dynamic: license-file
@@ -17,8 +17,7 @@
17
17
  import weakref
18
18
 
19
19
  from google.cloud import bigquery
20
- from google.cloud.bigquery.dbapi import cursor
21
- from google.cloud.bigquery.dbapi import _helpers
20
+ from google.cloud.bigquery.dbapi import _helpers, cursor
22
21
 
23
22
 
24
23
  @_helpers.raise_on_closed("Operating on a closed connection.")
@@ -84,7 +83,17 @@ class Connection(object):
84
83
 
85
84
  if self._owns_bqstorage_client:
86
85
  # There is no close() on the BQ Storage client itself.
87
- self._bqstorage_client._transport.close()
86
+ transport = self._bqstorage_client.transport
87
+ transport.close()
88
+
89
+ # Ensure the underlying gRPC channel is closed explicitly.
90
+ # This is important because the transport might be wrapped by interceptors
91
+ # which may not propagate the close call to the underlying channel immediately,
92
+ # or Garbage Collection delays might keep sockets open longer than expected,
93
+ # leading to intermittent socket leaks in tests.
94
+ channel = getattr(transport, "_grpc_channel", None)
95
+ if channel is not None:
96
+ channel.close()
88
97
 
89
98
  for cursor_ in self._cursors_created:
90
99
  if not cursor_._closed:
@@ -17,8 +17,8 @@
17
17
  from __future__ import annotations
18
18
 
19
19
  import collections
20
- from collections import abc as collections_abc
21
20
  import re
21
+ from collections import abc as collections_abc
22
22
  from typing import Optional
23
23
 
24
24
  try:
@@ -29,11 +29,9 @@ else:
29
29
  # Having BQ Storage available implies that pyarrow >=1.0.0 is available, too.
30
30
  _ARROW_COMPRESSION_SUPPORT = True
31
31
 
32
- from google.cloud.bigquery import job
33
- from google.cloud.bigquery.dbapi import _helpers
34
- from google.cloud.bigquery.dbapi import exceptions
35
32
  import google.cloud.exceptions # type: ignore
36
-
33
+ from google.cloud.bigquery import job
34
+ from google.cloud.bigquery.dbapi import _helpers, exceptions
37
35
 
38
36
  # Per PEP 249: A 7-item sequence containing information describing one result
39
37
  # column. The first two items (name and type_code) are mandatory, the other
@@ -105,6 +103,15 @@ class Cursor(object):
105
103
  """Mark the cursor as closed, preventing its further use."""
106
104
  self._closed = True
107
105
 
106
+ # Explicitly release references to query data and rows.
107
+ # This is important because these objects may hold references to underlying
108
+ # transports or gRPC streams (especially when using BQ Storage API).
109
+ # Clearing them ensures that resources can be garbage collected deterministically,
110
+ # preventing intermittent socket leaks (e.g., ESTABLISHED connections) in tests
111
+ # and long-running applications.
112
+ self._query_data = None
113
+ self._query_rows = None
114
+
108
115
  def _set_description(self, schema):
109
116
  """Set description from schema.
110
117
 
@@ -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.42.2"
15
+ __version__ = "3.42.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-bigquery
3
- Version: 3.42.2
3
+ Version: 3.42.3
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
@@ -27,16 +27,14 @@ Requires-Dist: packaging>=24.2.0
27
27
  Requires-Dist: python-dateutil<3.0.0,>=2.8.2
28
28
  Requires-Dist: requests<3.0.0,>=2.21.0
29
29
  Provides-Extra: bqstorage
30
- Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "bqstorage"
31
- Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "bqstorage"
32
- Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version >= "3.11" and extra == "bqstorage"
30
+ Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.29.0; extra == "bqstorage"
31
+ Requires-Dist: grpcio<2.0.0,>=1.59.0; extra == "bqstorage"
33
32
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "bqstorage"
34
33
  Requires-Dist: pyarrow>=4.0.0; extra == "bqstorage"
35
34
  Provides-Extra: pandas
36
35
  Requires-Dist: pandas>=1.3.0; extra == "pandas"
37
36
  Requires-Dist: pandas-gbq>=0.26.1; extra == "pandas"
38
- Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "pandas"
39
- Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version >= "3.11" and extra == "pandas"
37
+ Requires-Dist: grpcio<2.0.0,>=1.59.0; extra == "pandas"
40
38
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "pandas"
41
39
  Requires-Dist: pyarrow>=3.0.0; extra == "pandas"
42
40
  Requires-Dist: db-dtypes<2.0.0,>=1.0.4; extra == "pandas"
@@ -58,8 +56,8 @@ Requires-Dist: opentelemetry-api>=1.1.0; extra == "opentelemetry"
58
56
  Requires-Dist: opentelemetry-sdk>=1.1.0; extra == "opentelemetry"
59
57
  Requires-Dist: opentelemetry-instrumentation>=0.20b0; extra == "opentelemetry"
60
58
  Provides-Extra: bigquery-v2
61
- Requires-Dist: proto-plus<2.0.0,>=1.22.3; extra == "bigquery-v2"
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"
59
+ Requires-Dist: proto-plus<2.0.0,>=1.26.1; extra == "bigquery-v2"
60
+ Requires-Dist: protobuf<8.0.0,>=6.33.5; extra == "bigquery-v2"
63
61
  Provides-Extra: all
64
62
  Requires-Dist: google-cloud-bigquery[bigquery_v2,bqstorage,geopandas,ipython,ipywidgets,matplotlib,opentelemetry,pandas,tqdm]; extra == "all"
65
63
  Dynamic: license-file
@@ -10,17 +10,14 @@ requests<3.0.0,>=2.21.0
10
10
  google-cloud-bigquery[bigquery_v2,bqstorage,geopandas,ipython,ipywidgets,matplotlib,opentelemetry,pandas,tqdm]
11
11
 
12
12
  [bigquery_v2]
13
- proto-plus<2.0.0,>=1.22.3
14
- 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
13
+ proto-plus<2.0.0,>=1.26.1
14
+ protobuf<8.0.0,>=6.33.5
15
15
 
16
16
  [bqstorage]
17
- google-cloud-bigquery-storage<3.0.0,>=2.18.0
18
- grpcio<2.0.0,>=1.47.0
17
+ google-cloud-bigquery-storage<3.0.0,>=2.29.0
18
+ grpcio<2.0.0,>=1.59.0
19
19
  pyarrow>=4.0.0
20
20
 
21
- [bqstorage:python_version >= "3.11"]
22
- grpcio<2.0.0,>=1.49.1
23
-
24
21
  [bqstorage:python_version >= "3.14"]
25
22
  grpcio<2.0.0,>=1.75.1
26
23
 
@@ -47,13 +44,10 @@ opentelemetry-instrumentation>=0.20b0
47
44
  [pandas]
48
45
  pandas>=1.3.0
49
46
  pandas-gbq>=0.26.1
50
- grpcio<2.0.0,>=1.47.0
47
+ grpcio<2.0.0,>=1.59.0
51
48
  pyarrow>=3.0.0
52
49
  db-dtypes<2.0.0,>=1.0.4
53
50
 
54
- [pandas:python_version >= "3.11"]
55
- grpcio<2.0.0,>=1.49.1
56
-
57
51
  [pandas:python_version >= "3.14"]
58
52
  grpcio<2.0.0,>=1.75.1
59
53
 
@@ -59,23 +59,21 @@ Repository = "https://github.com/googleapis/python-bigquery"
59
59
  # moved back to optional due to bloat. See
60
60
  # https://github.com/googleapis/python-bigquery/issues/1196 for more background.
61
61
  bqstorage = [
62
- "google-cloud-bigquery-storage >= 2.18.0, < 3.0.0",
62
+ "google-cloud-bigquery-storage >= 2.29.0, < 3.0.0",
63
63
  # Due to an issue in pip's dependency resolver, the `grpc` extra is not
64
64
  # installed, even though `google-cloud-bigquery-storage` specifies it
65
65
  # as `google-api-core[grpc]`. We thus need to explicitly specify it here.
66
66
  # See: https://github.com/googleapis/python-bigquery/issues/83 The
67
67
  # grpc.Channel.close() method isn't added until 1.32.0.
68
68
  # https://github.com/grpc/grpc/pull/15254
69
- "grpcio >= 1.47.0, < 2.0.0",
70
- "grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'",
69
+ "grpcio >= 1.59.0, < 2.0.0",
71
70
  "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
72
71
  "pyarrow >= 4.0.0",
73
72
  ]
74
73
  pandas = [
75
74
  "pandas >= 1.3.0",
76
75
  "pandas-gbq >= 0.26.1",
77
- "grpcio >= 1.47.0, < 2.0.0",
78
- "grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'",
76
+ "grpcio >= 1.59.0, < 2.0.0",
79
77
  "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
80
78
  "pyarrow >= 3.0.0",
81
79
  "db-dtypes >= 1.0.4, < 2.0.0",
@@ -93,8 +91,8 @@ opentelemetry = [
93
91
  "opentelemetry-instrumentation >= 0.20b0",
94
92
  ]
95
93
  bigquery_v2 = [
96
- "proto-plus >= 1.22.3, < 2.0.0",
97
- "protobuf >= 3.20.2, < 7.0.0, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5", # For the legacy proto-based types.
94
+ "proto-plus >= 1.26.1, < 2.0.0",
95
+ "protobuf >= 6.33.5, < 8.0.0", # For the legacy proto-based types.
98
96
  ]
99
97
  all = [
100
98
  "google-cloud-bigquery[bqstorage,pandas,ipywidgets,geopandas,ipython,matplotlib,tqdm,opentelemetry,bigquery_v2]",
@@ -22,38 +22,36 @@ import json
22
22
  import operator
23
23
  import os
24
24
  import pathlib
25
+ import random
26
+ import string
25
27
  import time
26
28
  import unittest
27
29
  import uuid
28
- import random
29
- import string
30
30
  from typing import Optional
31
31
 
32
- from google.api_core.exceptions import PreconditionFailed
33
- from google.api_core.exceptions import BadRequest
34
- from google.api_core.exceptions import ClientError
35
- from google.api_core.exceptions import Conflict
36
- from google.api_core.exceptions import GoogleAPICallError
37
- from google.api_core.exceptions import NotFound
38
- from google.api_core.exceptions import InternalServerError
39
- from google.api_core.exceptions import ServiceUnavailable
40
- from google.api_core.exceptions import TooManyRequests
41
- from google.cloud import bigquery
42
- from google.cloud.bigquery.dataset import Dataset
43
- from google.cloud.bigquery.dataset import DatasetReference
44
- from google.cloud.bigquery.table import Table
32
+ import psutil
33
+ import pytest
34
+ from google.api_core.exceptions import (
35
+ BadRequest,
36
+ ClientError,
37
+ Conflict,
38
+ GoogleAPICallError,
39
+ InternalServerError,
40
+ NotFound,
41
+ PreconditionFailed,
42
+ ServiceUnavailable,
43
+ TooManyRequests,
44
+ )
45
+ from google.cloud import bigquery, storage
45
46
  from google.cloud._helpers import UTC
46
47
  from google.cloud.bigquery import dbapi, enums
47
- from google.cloud import storage
48
- from google.cloud.datacatalog_v1 import types as datacatalog_types
48
+ from google.cloud.bigquery.dataset import Dataset, DatasetReference
49
+ from google.cloud.bigquery.table import Table
49
50
  from google.cloud.datacatalog_v1 import PolicyTagManagerClient
50
- from google.cloud.resourcemanager_v3 import types as resourcemanager_types
51
+ from google.cloud.datacatalog_v1 import types as datacatalog_types
51
52
  from google.cloud.resourcemanager_v3 import TagKeysClient, TagValuesClient
52
- import psutil
53
- import pytest
54
- from test_utils.retry import RetryErrors
55
- from test_utils.retry import RetryInstanceState
56
- from test_utils.retry import RetryResult
53
+ from google.cloud.resourcemanager_v3 import types as resourcemanager_types
54
+ from test_utils.retry import RetryErrors, RetryInstanceState, RetryResult
57
55
  from test_utils.system import unique_resource_id
58
56
 
59
57
  from . import helpers
@@ -254,8 +252,13 @@ class TestBigQuery(unittest.TestCase):
254
252
  import gc
255
253
 
256
254
  gc.collect()
257
- conn_end = current_process.net_connections()
258
- conn_count_end = len(conn_end)
255
+ for _ in range(30): # Wait up to 3 seconds
256
+ conn_end = current_process.net_connections()
257
+ conn_count_end = len(conn_end)
258
+ if conn_count_end <= conn_count_start:
259
+ break
260
+ time.sleep(0.1)
261
+
259
262
  self.assertLessEqual(conn_count_end, conn_count_start)
260
263
 
261
264
  def test_create_dataset(self):
@@ -635,8 +638,7 @@ class TestBigQuery(unittest.TestCase):
635
638
  self.assertEqual("FOO", row_2.get("username"))
636
639
 
637
640
  def test_create_table_w_time_partitioning_w_clustering_fields(self):
638
- from google.cloud.bigquery.table import TimePartitioning
639
- from google.cloud.bigquery.table import TimePartitioningType
641
+ from google.cloud.bigquery.table import TimePartitioning, TimePartitioningType
640
642
 
641
643
  dataset = self.temp_dataset(_make_dataset_id("create_table_tp_cf"))
642
644
  table_id = "test_table"
@@ -964,12 +966,12 @@ class TestBigQuery(unittest.TestCase):
964
966
  self.assertIsNone(table3.clustering_fields, None)
965
967
 
966
968
  def test_update_table_constraints(self):
967
- from google.cloud.bigquery.table import TableConstraints
968
969
  from google.cloud.bigquery.table import (
969
- PrimaryKey,
970
+ ColumnReference,
970
971
  ForeignKey,
972
+ PrimaryKey,
973
+ TableConstraints,
971
974
  TableReference,
972
- ColumnReference,
973
975
  )
974
976
 
975
977
  dataset = self.temp_dataset(_make_dataset_id("update_table"))
@@ -1128,8 +1130,7 @@ class TestBigQuery(unittest.TestCase):
1128
1130
  self.assertEqual(sorted(row_tuples, key=by_age), sorted(ROWS, key=by_age))
1129
1131
 
1130
1132
  def test_load_table_from_local_avro_file_then_dump_table(self):
1131
- from google.cloud.bigquery.job import SourceFormat
1132
- from google.cloud.bigquery.job import WriteDisposition
1133
+ from google.cloud.bigquery.job import SourceFormat, WriteDisposition
1133
1134
 
1134
1135
  TABLE_NAME = "test_table_avro"
1135
1136
  ROWS = [
@@ -1169,8 +1170,7 @@ class TestBigQuery(unittest.TestCase):
1169
1170
 
1170
1171
  def test_load_table_from_local_parquet_file_decimal_types(self):
1171
1172
  from google.cloud.bigquery.enums import DecimalTargetType
1172
- from google.cloud.bigquery.job import SourceFormat
1173
- from google.cloud.bigquery.job import WriteDisposition
1173
+ from google.cloud.bigquery.job import SourceFormat, WriteDisposition
1174
1174
 
1175
1175
  TABLE_NAME = "test_table_parquet"
1176
1176
 
@@ -1359,9 +1359,11 @@ class TestBigQuery(unittest.TestCase):
1359
1359
  self.assertEqual(table.num_rows, 3)
1360
1360
 
1361
1361
  def test_load_avro_from_uri_then_dump_table(self):
1362
- from google.cloud.bigquery.job import CreateDisposition
1363
- from google.cloud.bigquery.job import SourceFormat
1364
- from google.cloud.bigquery.job import WriteDisposition
1362
+ from google.cloud.bigquery.job import (
1363
+ CreateDisposition,
1364
+ SourceFormat,
1365
+ WriteDisposition,
1366
+ )
1365
1367
 
1366
1368
  table_name = "test_table"
1367
1369
  rows = [
@@ -1399,9 +1401,11 @@ class TestBigQuery(unittest.TestCase):
1399
1401
  )
1400
1402
 
1401
1403
  def test_load_table_from_uri_then_dump_table(self):
1402
- from google.cloud.bigquery.job import CreateDisposition
1403
- from google.cloud.bigquery.job import SourceFormat
1404
- from google.cloud.bigquery.job import WriteDisposition
1404
+ from google.cloud.bigquery.job import (
1405
+ CreateDisposition,
1406
+ SourceFormat,
1407
+ WriteDisposition,
1408
+ )
1405
1409
 
1406
1410
  TABLE_ID = "test_table"
1407
1411
  GS_URL = self._write_csv_to_storage(
@@ -2202,15 +2206,41 @@ class TestBigQuery(unittest.TestCase):
2202
2206
  import gc
2203
2207
 
2204
2208
  gc.collect()
2205
- conn_end = current_process.net_connections()
2206
- conn_count_end = len(conn_end)
2207
- self.assertLessEqual(conn_count_end, conn_count_start)
2209
+ for _ in range(30): # Wait up to 3 seconds
2210
+ conn_end = current_process.net_connections()
2211
+ conn_count_end = len(conn_end)
2212
+ if conn_count_end <= conn_count_start:
2213
+ break
2214
+ time.sleep(0.1)
2215
+
2216
+ try:
2217
+ self.assertLessEqual(conn_count_end, conn_count_start)
2218
+ except AssertionError as e:
2219
+ # Due to flakiness in this test (likely caused by OS cleanup delays or
2220
+ # non-deterministic garbage collection of sockets), we want to capture
2221
+ # the detailed state of connections in future failing runs to help
2222
+ # decrease false positives and identify the root cause.
2223
+ conn_debug = [
2224
+ f"Status: {c.status}, Laddr: {c.laddr}, Raddr: {c.raddr}"
2225
+ for c in current_process.net_connections()
2226
+ ]
2227
+ debug_msg = "\n".join(conn_debug)
2228
+
2229
+ raise AssertionError(
2230
+ f"{e}\n\n"
2231
+ f"--- Socket Leak Debug Info ---\n"
2232
+ f"Start Count: {conn_count_start}\n"
2233
+ f"End Count: {conn_count_end}\n"
2234
+ f"Current Connections:\n{debug_msg}"
2235
+ )
2208
2236
 
2209
2237
  def _load_table_for_dml(self, rows, dataset_id, table_id):
2210
2238
  from google.cloud._testing import _NamedTemporaryFile
2211
- from google.cloud.bigquery.job import CreateDisposition
2212
- from google.cloud.bigquery.job import SourceFormat
2213
- from google.cloud.bigquery.job import WriteDisposition
2239
+ from google.cloud.bigquery.job import (
2240
+ CreateDisposition,
2241
+ SourceFormat,
2242
+ WriteDisposition,
2243
+ )
2214
2244
 
2215
2245
  dataset = self.temp_dataset(dataset_id)
2216
2246
  greeting = bigquery.SchemaField("greeting", "STRING", mode="NULLABLE")
@@ -2732,8 +2762,7 @@ class TestBigQuery(unittest.TestCase):
2732
2762
  bigquery_storage = pytest.importorskip("google.cloud.bigquery_storage")
2733
2763
  pyarrow = pytest.importorskip("pyarrow")
2734
2764
  pyarrow.types = pytest.importorskip("pyarrow.types")
2735
- from google.cloud.bigquery.job import SourceFormat
2736
- from google.cloud.bigquery.job import WriteDisposition
2765
+ from google.cloud.bigquery.job import SourceFormat, WriteDisposition
2737
2766
 
2738
2767
  SF = bigquery.SchemaField
2739
2768
  schema = [
@@ -2865,8 +2894,7 @@ def test_parameterized_types_round_trip(dataset_id: str):
2865
2894
 
2866
2895
 
2867
2896
  def test_table_snapshots(dataset_id: str):
2868
- from google.cloud.bigquery import CopyJobConfig
2869
- from google.cloud.bigquery import OperationType
2897
+ from google.cloud.bigquery import CopyJobConfig, OperationType
2870
2898
 
2871
2899
  client = Config.CLIENT
2872
2900
 
@@ -2936,8 +2964,7 @@ def test_table_snapshots(dataset_id: str):
2936
2964
 
2937
2965
 
2938
2966
  def test_table_clones(dataset_id: str):
2939
- from google.cloud.bigquery import CopyJobConfig
2940
- from google.cloud.bigquery import OperationType
2967
+ from google.cloud.bigquery import CopyJobConfig, OperationType
2941
2968
 
2942
2969
  client = Config.CLIENT
2943
2970
 
@@ -15,9 +15,10 @@
15
15
  """System tests for Jupyter/IPython connector."""
16
16
 
17
17
  import re
18
+ import time
18
19
 
19
- import pytest
20
20
  import psutil
21
+ import pytest
21
22
 
22
23
  from . import helpers
23
24
 
@@ -71,8 +72,16 @@ def test_bigquery_magic(ipython_interactive):
71
72
  with io.capture_output() as captured:
72
73
  result = ip.run_cell_magic("bigquery", "--use_rest_api", sql)
73
74
 
74
- conn_end = current_process.net_connections()
75
- conn_count_end = len(conn_end)
75
+ import gc
76
+
77
+ gc.collect()
78
+
79
+ for _ in range(30): # Wait up to 3 seconds
80
+ conn_end = current_process.net_connections()
81
+ conn_count_end = len(conn_end)
82
+ if conn_count_end <= conn_count_start:
83
+ break
84
+ time.sleep(0.1)
76
85
 
77
86
  lines = re.split("\n|\r", captured.stdout)
78
87
  # Removes blanks & terminal code (result of display clearing)
@@ -15,11 +15,10 @@
15
15
  from unittest import mock
16
16
 
17
17
  import google.api_core.retry
18
+ import google.cloud.bigquery.job
18
19
  from google.api_core import exceptions
19
20
 
20
21
  from . import helpers
21
- import google.cloud.bigquery.job
22
-
23
22
 
24
23
  PROJECT = "test-project"
25
24
  JOB_ID = "test-job-id"
@@ -110,7 +109,7 @@ def test_result_w_retry_wo_state(global_time_lock):
110
109
  predicate=custom_predicate,
111
110
  initial=0.001,
112
111
  maximum=0.001,
113
- deadline=0.1,
112
+ deadline=1.0,
114
113
  )
115
114
  assert job.result(retry=custom_retry) is job
116
115
 
@@ -11,14 +11,13 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
+ import concurrent.futures
14
15
  from unittest import mock
15
16
 
16
- import concurrent.futures
17
17
  import freezegun
18
- from google.api_core import exceptions
19
18
  import google.api_core.retry
20
19
  import pytest
21
-
20
+ from google.api_core import exceptions
22
21
  from google.cloud.bigquery.client import _MIN_GET_QUERY_RESULTS_TIMEOUT
23
22
  from google.cloud.bigquery.job import QueryJob
24
23
  from google.cloud.bigquery.retry import DEFAULT_GET_JOB_TIMEOUT
@@ -27,7 +26,6 @@ from google.cloud.bigquery.table import RowIterator
27
26
  from ..helpers import make_connection
28
27
  from .helpers import _make_client
29
28
 
30
-
31
29
  PROJECT = "test-project"
32
30
  JOB_ID = "test-job-id"
33
31
  QUERY = "select count(*) from persons"
@@ -105,7 +103,7 @@ def test_result_w_custom_retry(global_time_lock):
105
103
  initial=0.001,
106
104
  maximum=0.001,
107
105
  multiplier=1.0,
108
- deadline=0.1,
106
+ deadline=1.0,
109
107
  predicate=custom_predicate,
110
108
  )
111
109
 
@@ -13,10 +13,11 @@
13
13
  # limitations under the License.
14
14
 
15
15
  import gc
16
- import pytest
17
16
  import unittest
18
17
  from unittest import mock
19
18
 
19
+ import pytest
20
+
20
21
 
21
22
  class TestConnection(unittest.TestCase):
22
23
  @staticmethod
@@ -40,8 +41,8 @@ class TestConnection(unittest.TestCase):
40
41
  from google.cloud import bigquery_storage
41
42
 
42
43
  mock_client = mock.create_autospec(bigquery_storage.BigQueryReadClient)
43
- mock_client._transport = mock.Mock(spec=["channel", "close"])
44
- mock_client._transport.grpc_channel = mock.Mock(spec=["close"])
44
+ mock_client.transport.close = mock.Mock()
45
+ mock_client.transport._grpc_channel = mock.Mock(spec=["close"])
45
46
  return mock_client
46
47
 
47
48
  def test_ctor_wo_bqstorage_client(self):
@@ -77,8 +78,7 @@ class TestConnection(unittest.TestCase):
77
78
 
78
79
  @mock.patch("google.cloud.bigquery.Client", autospec=True)
79
80
  def test_connect_wo_client(self, mock_client):
80
- from google.cloud.bigquery.dbapi import connect
81
- from google.cloud.bigquery.dbapi import Connection
81
+ from google.cloud.bigquery.dbapi import Connection, connect
82
82
 
83
83
  connection = connect()
84
84
  self.assertIsInstance(connection, Connection)
@@ -87,8 +87,7 @@ class TestConnection(unittest.TestCase):
87
87
 
88
88
  def test_connect_w_client(self):
89
89
  pytest.importorskip("google.cloud.bigquery_storage")
90
- from google.cloud.bigquery.dbapi import connect
91
- from google.cloud.bigquery.dbapi import Connection
90
+ from google.cloud.bigquery.dbapi import Connection, connect
92
91
 
93
92
  mock_client = self._mock_client()
94
93
  mock_bqstorage_client = self._mock_bqstorage_client()
@@ -103,8 +102,7 @@ class TestConnection(unittest.TestCase):
103
102
 
104
103
  def test_connect_w_both_clients(self):
105
104
  pytest.importorskip("google.cloud.bigquery_storage")
106
- from google.cloud.bigquery.dbapi import connect
107
- from google.cloud.bigquery.dbapi import Connection
105
+ from google.cloud.bigquery.dbapi import Connection, connect
108
106
 
109
107
  mock_client = self._mock_client()
110
108
  mock_bqstorage_client = self._mock_bqstorage_client()
@@ -124,8 +122,7 @@ class TestConnection(unittest.TestCase):
124
122
 
125
123
  def test_connect_prefer_bqstorage_client_false(self):
126
124
  pytest.importorskip("google.cloud.bigquery_storage")
127
- from google.cloud.bigquery.dbapi import connect
128
- from google.cloud.bigquery.dbapi import Connection
125
+ from google.cloud.bigquery.dbapi import Connection, connect
129
126
 
130
127
  mock_client = self._mock_client()
131
128
  mock_bqstorage_client = self._mock_bqstorage_client()
@@ -155,11 +152,16 @@ class TestConnection(unittest.TestCase):
155
152
  ):
156
153
  getattr(connection, method)()
157
154
 
158
- def test_close_closes_all_created_bigquery_clients(self):
155
+ def _verify_close_closes_all_created_bigquery_clients(
156
+ self, simulate_no_grpc_channel=False
157
+ ):
159
158
  pytest.importorskip("google.cloud.bigquery_storage")
160
159
  client = self._mock_client()
161
160
  bqstorage_client = self._mock_bqstorage_client()
162
161
 
162
+ if simulate_no_grpc_channel:
163
+ bqstorage_client.transport._grpc_channel = None
164
+
163
165
  client_patcher = mock.patch(
164
166
  "google.cloud.bigquery.dbapi.connection.bigquery.Client",
165
167
  return_value=client,
@@ -176,7 +178,20 @@ class TestConnection(unittest.TestCase):
176
178
  connection.close()
177
179
 
178
180
  self.assertTrue(client.close.called)
179
- self.assertTrue(bqstorage_client._transport.close.called)
181
+ self.assertTrue(bqstorage_client.transport.close.called)
182
+
183
+ if not simulate_no_grpc_channel:
184
+ self.assertTrue(bqstorage_client.transport._grpc_channel.close.called)
185
+
186
+ def test_close_closes_all_created_bigquery_clients(self):
187
+ self._verify_close_closes_all_created_bigquery_clients(
188
+ simulate_no_grpc_channel=False
189
+ )
190
+
191
+ def test_close_closes_all_created_bigquery_clients_no_grpc_channel(self):
192
+ self._verify_close_closes_all_created_bigquery_clients(
193
+ simulate_no_grpc_channel=True
194
+ )
180
195
 
181
196
  def test_close_does_not_close_bigquery_clients_passed_to_it(self):
182
197
  pytest.importorskip("google.cloud.bigquery_storage")
@@ -187,7 +202,8 @@ class TestConnection(unittest.TestCase):
187
202
  connection.close()
188
203
 
189
204
  self.assertFalse(client.close.called)
190
- self.assertFalse(bqstorage_client._transport.close.called)
205
+ self.assertFalse(bqstorage_client.transport.close.called)
206
+ self.assertFalse(bqstorage_client.transport._grpc_channel.close.called)
191
207
 
192
208
  def test_close_closes_all_created_cursors(self):
193
209
  connection = self._make_one(client=self._mock_client())