google-cloud-bigquery 3.40.1__tar.gz → 3.41.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 (164) hide show
  1. {google_cloud_bigquery-3.40.1/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.41.0}/PKG-INFO +4 -3
  2. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/dbapi/cursor.py +1 -0
  3. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/job/query.py +25 -1
  4. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/table.py +93 -1
  5. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/version.py +1 -1
  6. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0/google_cloud_bigquery.egg-info}/PKG-INFO +4 -3
  7. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/pyproject.toml +3 -3
  8. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/setup.py +0 -1
  9. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/conftest.py +16 -9
  10. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_client.py +24 -11
  11. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_magics.py +2 -2
  12. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_pandas.py +1 -1
  13. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_query.py +12 -5
  14. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_async_job_retry.py +5 -4
  15. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_query.py +49 -0
  16. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_query_pandas.py +2 -2
  17. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test__pandas_helpers.py +46 -20
  18. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_client.py +4 -4
  19. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_table.py +26 -26
  20. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_table_pandas.py +4 -3
  21. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/LICENSE +0 -0
  22. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/MANIFEST.in +0 -0
  23. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/README.rst +0 -0
  24. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/__init__.py +0 -0
  25. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/_helpers.py +0 -0
  26. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/_http.py +0 -0
  27. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/_job_helpers.py +0 -0
  28. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/_pandas_helpers.py +0 -0
  29. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
  30. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
  31. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/_versions_helpers.py +0 -0
  32. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/client.py +0 -0
  33. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/dataset.py +0 -0
  34. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/dbapi/__init__.py +0 -0
  35. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
  36. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/dbapi/connection.py +0 -0
  37. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
  38. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/dbapi/types.py +0 -0
  39. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/encryption_configuration.py +0 -0
  40. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/enums.py +0 -0
  41. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/exceptions.py +0 -0
  42. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/external_config.py +0 -0
  43. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/format_options.py +0 -0
  44. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/iam.py +0 -0
  45. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/job/__init__.py +0 -0
  46. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/job/base.py +0 -0
  47. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/job/copy_.py +0 -0
  48. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/job/extract.py +0 -0
  49. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/job/load.py +0 -0
  50. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/magics/__init__.py +0 -0
  51. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
  52. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
  53. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
  54. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
  55. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
  56. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/magics/magics.py +0 -0
  57. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/model.py +0 -0
  58. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
  59. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/py.typed +0 -0
  60. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/query.py +0 -0
  61. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/retry.py +0 -0
  62. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/routine/__init__.py +0 -0
  63. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/routine/routine.py +0 -0
  64. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/schema.py +0 -0
  65. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery/standard_sql.py +0 -0
  66. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery_v2/__init__.py +0 -0
  67. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery_v2/types/__init__.py +0 -0
  68. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
  69. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery_v2/types/model.py +0 -0
  70. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
  71. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
  72. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
  73. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google_cloud_bigquery.egg-info/SOURCES.txt +0 -0
  74. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
  75. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google_cloud_bigquery.egg-info/requires.txt +0 -0
  76. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
  77. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/setup.cfg +0 -0
  78. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/__init__.py +0 -0
  79. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/characters.json +0 -0
  80. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/characters.jsonl +0 -0
  81. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/colors.avro +0 -0
  82. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/numeric_38_12.parquet +0 -0
  83. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/people.csv +0 -0
  84. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/pico.csv +0 -0
  85. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/pico_schema.json +0 -0
  86. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/scalars.csv +0 -0
  87. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/scalars.jsonl +0 -0
  88. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/scalars_extreme.jsonl +0 -0
  89. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/scalars_schema.json +0 -0
  90. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/scalars_schema_csv.json +0 -0
  91. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/data/schema.json +0 -0
  92. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/scrub_datasets.py +0 -0
  93. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/__init__.py +0 -0
  94. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/helpers.py +0 -0
  95. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_arrow.py +0 -0
  96. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_job_retry.py +0 -0
  97. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_list_rows.py +0 -0
  98. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/system/test_structs.py +0 -0
  99. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/__init__.py +0 -0
  100. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/_helpers/__init__.py +0 -0
  101. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/_helpers/test_cell_data_parser.py +0 -0
  102. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/_helpers/test_data_frame_cell_data_parser.py +0 -0
  103. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/_helpers/test_scalar_query_param_parser.py +0 -0
  104. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/conftest.py +0 -0
  105. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/helpers.py +0 -0
  106. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/__init__.py +0 -0
  107. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/helpers.py +0 -0
  108. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_base.py +0 -0
  109. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_copy.py +0 -0
  110. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_extract.py +0 -0
  111. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_load.py +0 -0
  112. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_load_config.py +0 -0
  113. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_query_config.py +0 -0
  114. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_query_job_retry.py +0 -0
  115. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/job/test_query_stats.py +0 -0
  116. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/line_arg_parser/__init__.py +0 -0
  117. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/line_arg_parser/test_lexer.py +0 -0
  118. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/line_arg_parser/test_parser.py +0 -0
  119. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/line_arg_parser/test_visitors.py +0 -0
  120. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/model/__init__.py +0 -0
  121. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/model/test_model.py +0 -0
  122. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/model/test_model_reference.py +0 -0
  123. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/routine/__init__.py +0 -0
  124. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/routine/test_external_runtime_options.py +0 -0
  125. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/routine/test_remote_function_options.py +0 -0
  126. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/routine/test_routine.py +0 -0
  127. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/routine/test_routine_argument.py +0 -0
  128. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/routine/test_routine_reference.py +0 -0
  129. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test__helpers.py +0 -0
  130. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test__http.py +0 -0
  131. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test__job_helpers.py +0 -0
  132. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test__job_helpers_retry.py +0 -0
  133. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test__pyarrow_helpers.py +0 -0
  134. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test__versions_helpers.py +0 -0
  135. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_client_bigframes.py +0 -0
  136. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_client_resumable_media_upload.py +0 -0
  137. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_client_retry.py +0 -0
  138. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_create_dataset.py +0 -0
  139. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_dataset.py +0 -0
  140. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_dbapi__helpers.py +0 -0
  141. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_dbapi_connection.py +0 -0
  142. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_dbapi_cursor.py +0 -0
  143. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_dbapi_types.py +0 -0
  144. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_delete_dataset.py +0 -0
  145. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_encryption_configuration.py +0 -0
  146. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_external_config.py +0 -0
  147. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_format_options.py +0 -0
  148. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_job_retry.py +0 -0
  149. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_legacy_types.py +0 -0
  150. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_list_datasets.py +0 -0
  151. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_list_jobs.py +0 -0
  152. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_list_models.py +0 -0
  153. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_list_projects.py +0 -0
  154. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_list_routines.py +0 -0
  155. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_list_tables.py +0 -0
  156. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_magics.py +0 -0
  157. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_opentelemetry_tracing.py +0 -0
  158. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_packaging.py +0 -0
  159. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_query.py +0 -0
  160. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_retry.py +0 -0
  161. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_schema.py +0 -0
  162. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_signature_compatibility.py +0 -0
  163. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_standard_sql_types.py +0 -0
  164. {google_cloud_bigquery-3.40.1 → google_cloud_bigquery-3.41.0}/tests/unit/test_table_arrow.py +0 -0
@@ -1,14 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-bigquery
3
- Version: 3.40.1
3
+ Version: 3.41.0
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
- License-Expression: Apache-2.0
6
+ License: Apache 2.0
7
7
  Project-URL: Repository, https://github.com/googleapis/python-bigquery
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: Programming Language :: Python
11
11
  Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
12
13
  Classifier: Programming Language :: Python :: 3.9
13
14
  Classifier: Programming Language :: Python :: 3.10
14
15
  Classifier: Programming Language :: Python :: 3.11
@@ -17,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.13
17
18
  Classifier: Programming Language :: Python :: 3.14
18
19
  Classifier: Operating System :: OS Independent
19
20
  Classifier: Topic :: Internet
20
- Requires-Python: >=3.9
21
+ Requires-Python: >=3.8
21
22
  Description-Content-Type: text/x-rst
22
23
  License-File: LICENSE
23
24
  Requires-Dist: google-api-core[grpc]<3.0.0,>=2.11.1
@@ -213,6 +213,7 @@ class Cursor(object):
213
213
  formatted_operation,
214
214
  job_config=job_config,
215
215
  job_id=job_id,
216
+ job_retry=None,
216
217
  ).result(
217
218
  page_size=self.arraysize,
218
219
  )
@@ -50,7 +50,7 @@ from google.cloud.bigquery.schema import SchemaField
50
50
  from google.cloud.bigquery.table import _EmptyRowIterator
51
51
  from google.cloud.bigquery.table import RangePartitioning
52
52
  from google.cloud.bigquery.table import _table_arg_to_table_ref
53
- from google.cloud.bigquery.table import TableReference
53
+ from google.cloud.bigquery.table import TableReference, PropertyGraphReference
54
54
  from google.cloud.bigquery.table import TimePartitioning
55
55
  from google.cloud.bigquery._tqdm_helpers import wait_for_query
56
56
 
@@ -1332,6 +1332,30 @@ class QueryJob(_AsyncJob):
1332
1332
 
1333
1333
  return tables
1334
1334
 
1335
+ @property
1336
+ def referenced_property_graphs(self):
1337
+ """Return referenced property graphs from job statistics, if present.
1338
+
1339
+ See:
1340
+ https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobStatistics2.FIELDS.referenced_property_graphs
1341
+
1342
+ Returns:
1343
+ List[google.cloud.bigquery.table.PropertyGraphReference]:
1344
+ mappings describing the property graphs, or an empty list
1345
+ if the query has not yet completed.
1346
+ """
1347
+ property_graphs = []
1348
+
1349
+ for pg in self._job_statistics().get("referencedPropertyGraphs", ()):
1350
+ property_graphs.append(
1351
+ PropertyGraphReference(
1352
+ DatasetReference(pg["projectId"], pg["datasetId"]),
1353
+ pg["propertyGraphId"],
1354
+ )
1355
+ )
1356
+
1357
+ return property_graphs
1358
+
1335
1359
  @property
1336
1360
  def undeclared_query_parameters(self):
1337
1361
  """Return undeclared query parameters from job statistics, if present.
@@ -138,7 +138,7 @@ def _reference_getter(table):
138
138
 
139
139
 
140
140
  def _view_use_legacy_sql_getter(
141
- table: Union["Table", "TableListItem"]
141
+ table: Union["Table", "TableListItem"],
142
142
  ) -> Optional[bool]:
143
143
  """bool: Specifies whether to execute the view with Legacy or Standard SQL.
144
144
 
@@ -359,6 +359,98 @@ class TableReference(_TableBase):
359
359
  return f"TableReference({dataset_ref!r}, '{self.table_id}')"
360
360
 
361
361
 
362
+ class PropertyGraphReference:
363
+ """PropertyGraphReferences are pointers to property graphs.
364
+
365
+ Args:
366
+ dataset_ref: A pointer to the dataset
367
+ property_graph_id: The ID of the property graph
368
+ """
369
+
370
+ _PROPERTY_TO_API_FIELD = {
371
+ "dataset_id": "datasetId",
372
+ "project": "projectId",
373
+ "property_graph_id": "propertyGraphId",
374
+ }
375
+
376
+ def __init__(self, dataset_ref: "DatasetReference", property_graph_id: str):
377
+ self._properties: Dict[str, Any] = {}
378
+
379
+ _helpers._set_sub_prop(
380
+ self._properties,
381
+ self._PROPERTY_TO_API_FIELD["project"],
382
+ dataset_ref.project,
383
+ )
384
+ _helpers._set_sub_prop(
385
+ self._properties,
386
+ self._PROPERTY_TO_API_FIELD["dataset_id"],
387
+ dataset_ref.dataset_id,
388
+ )
389
+ _helpers._set_sub_prop(
390
+ self._properties,
391
+ self._PROPERTY_TO_API_FIELD["property_graph_id"],
392
+ property_graph_id,
393
+ )
394
+
395
+ @property
396
+ def project(self) -> str:
397
+ """str: Project bound to the property graph."""
398
+ return _helpers._get_sub_prop(
399
+ self._properties, self._PROPERTY_TO_API_FIELD["project"]
400
+ )
401
+
402
+ @property
403
+ def dataset_id(self) -> str:
404
+ """str: ID of dataset containing the property graph."""
405
+ return _helpers._get_sub_prop(
406
+ self._properties, self._PROPERTY_TO_API_FIELD["dataset_id"]
407
+ )
408
+
409
+ @property
410
+ def property_graph_id(self) -> str:
411
+ """str: The property graph ID."""
412
+ return _helpers._get_sub_prop(
413
+ self._properties, self._PROPERTY_TO_API_FIELD["property_graph_id"]
414
+ )
415
+
416
+ @classmethod
417
+ def from_api_repr(cls, resource: dict) -> "PropertyGraphReference":
418
+ """Factory: construct a property graph reference given its API representation."""
419
+ from google.cloud.bigquery.dataset import DatasetReference
420
+
421
+ project = resource["projectId"]
422
+ dataset_id = resource["datasetId"]
423
+ property_graph_id = resource["propertyGraphId"]
424
+
425
+ return cls(DatasetReference(project, dataset_id), property_graph_id)
426
+
427
+ def to_api_repr(self) -> dict:
428
+ """Construct the API resource representation of this property graph reference."""
429
+ return copy.deepcopy(self._properties)
430
+
431
+ def __str__(self):
432
+ return f"{self.project}.{self.dataset_id}.{self.property_graph_id}"
433
+
434
+ def __repr__(self):
435
+ from google.cloud.bigquery.dataset import DatasetReference
436
+
437
+ dataset_ref = DatasetReference(self.project, self.dataset_id)
438
+ return f"PropertyGraphReference({dataset_ref!r}, '{self.property_graph_id}')"
439
+
440
+ def __eq__(self, other):
441
+ if isinstance(other, PropertyGraphReference):
442
+ return (
443
+ self.project == other.project
444
+ and self.dataset_id == other.dataset_id
445
+ and self.property_graph_id == other.property_graph_id
446
+ )
447
+ else:
448
+ return NotImplemented
449
+
450
+ def __hash__(self):
451
+ return hash((self.project, self.dataset_id, self.property_graph_id))
452
+
453
+
362
454
  class Table(_TableBase):
363
455
  """Tables represent a set of rows whose values correspond to a schema.
364
456
 
@@ -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.40.1"
15
+ __version__ = "3.41.0"
@@ -1,14 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-bigquery
3
- Version: 3.40.1
3
+ Version: 3.41.0
4
4
  Summary: Google BigQuery API client library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
- License-Expression: Apache-2.0
6
+ License: Apache 2.0
7
7
  Project-URL: Repository, https://github.com/googleapis/python-bigquery
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: Programming Language :: Python
11
11
  Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
12
13
  Classifier: Programming Language :: Python :: 3.9
13
14
  Classifier: Programming Language :: Python :: 3.10
14
15
  Classifier: Programming Language :: Python :: 3.11
@@ -17,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.13
17
18
  Classifier: Programming Language :: Python :: 3.14
18
19
  Classifier: Operating System :: OS Independent
19
20
  Classifier: Topic :: Internet
20
- Requires-Python: >=3.9
21
+ Requires-Python: >=3.8
21
22
  Description-Content-Type: text/x-rst
22
23
  License-File: LICENSE
23
24
  Requires-Dist: google-api-core[grpc]<3.0.0,>=2.11.1
@@ -19,9 +19,8 @@ build-backend = "setuptools.build_meta"
19
19
  [project]
20
20
  name = "google-cloud-bigquery"
21
21
  authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }]
22
- license = "Apache-2.0"
23
- license-files = ["LICENSE"]
24
- requires-python = ">=3.9"
22
+ license = { text = "Apache 2.0" }
23
+ requires-python = ">=3.8"
25
24
  description = "Google BigQuery API client library"
26
25
  readme = "README.rst"
27
26
  classifiers = [
@@ -33,6 +32,7 @@ classifiers = [
33
32
  "Intended Audience :: Developers",
34
33
  "Programming Language :: Python",
35
34
  "Programming Language :: Python :: 3",
35
+ "Programming Language :: Python :: 3.8",
36
36
  "Programming Language :: Python :: 3.9",
37
37
  "Programming Language :: Python :: 3.10",
38
38
  "Programming Language :: Python :: 3.11",
@@ -14,5 +14,4 @@
14
14
 
15
15
  import setuptools # type: ignore
16
16
 
17
-
18
17
  setuptools.setup()
@@ -175,15 +175,22 @@ def scalars_table_csv(
175
175
  def scalars_table_pico(
176
176
  bigquery_client: bigquery.Client, project_id: str, dataset_id: str
177
177
  ):
178
- full_table_id = load_scalars_table(
179
- bigquery_client,
180
- project_id,
181
- dataset_id,
182
- data_path="pico.csv",
183
- source_format=enums.SourceFormat.CSV,
184
- schema_source="pico_schema.json",
185
- timestamp_target_precision=[12],
186
- )
178
+ from google.api_core import exceptions
179
+
180
+ try:
181
+ full_table_id = load_scalars_table(
182
+ bigquery_client,
183
+ project_id,
184
+ dataset_id,
185
+ data_path="pico.csv",
186
+ source_format=enums.SourceFormat.CSV,
187
+ schema_source="pico_schema.json",
188
+ timestamp_target_precision=[12],
189
+ )
190
+ except exceptions.BadRequest as exc:
191
+ if "picosecond precision" in str(exc):
192
+ pytest.skip("Picosecond precision not supported in this environment")
193
+ raise exc
187
194
  yield full_table_id
188
195
  bigquery_client.delete_table(full_table_id, not_found_ok=True)
189
196
 
@@ -234,7 +234,7 @@ class TestBigQuery(unittest.TestCase):
234
234
 
235
235
  def test_close_releases_open_sockets(self):
236
236
  current_process = psutil.Process()
237
- conn_count_start = len(current_process.connections())
237
+ conn_count_start = len(current_process.net_connections())
238
238
 
239
239
  client = Config.CLIENT
240
240
  client.query(
@@ -250,7 +250,7 @@ class TestBigQuery(unittest.TestCase):
250
250
 
251
251
  client.close()
252
252
 
253
- conn_count_end = len(current_process.connections())
253
+ conn_count_end = len(current_process.net_connections())
254
254
  self.assertLessEqual(conn_count_end, conn_count_start)
255
255
 
256
256
  def test_create_dataset(self):
@@ -601,7 +601,7 @@ class TestBigQuery(unittest.TestCase):
601
601
  # Insert rows into the created table to verify default values are populated
602
602
  # when value is not provided
603
603
  NOW_SECONDS = 1448911495.484366
604
- NOW = datetime.datetime.utcfromtimestamp(NOW_SECONDS).replace(tzinfo=UTC)
604
+ NOW = datetime.datetime.fromtimestamp(NOW_SECONDS, datetime.timezone.utc)
605
605
 
606
606
  # Rows to insert. Row #1 will have default `TIMESTAMP` defaultValueExpression CURRENT_TIME
607
607
  # Row #2 will have default `STRING` defaultValueExpression "'FOO"
@@ -647,7 +647,13 @@ class TestBigQuery(unittest.TestCase):
647
647
  table_arg = Table(dataset.table(table_id), schema=SCHEMA_PICOSECOND)
648
648
  self.assertFalse(_table_exists(table_arg))
649
649
 
650
- table = helpers.retry_403(Config.CLIENT.create_table)(table_arg)
650
+ try:
651
+ table = helpers.retry_403(Config.CLIENT.create_table)(table_arg)
652
+ except BadRequest as exc:
653
+ if "picosecond precision" in str(exc):
654
+ self.skipTest("Picosecond precision not supported in this environment")
655
+ raise exc
656
+
651
657
  self.to_delete.insert(0, table)
652
658
 
653
659
  self.assertTrue(_table_exists(table))
@@ -1056,7 +1062,7 @@ class TestBigQuery(unittest.TestCase):
1056
1062
 
1057
1063
  def test_insert_rows_then_dump_table(self):
1058
1064
  NOW_SECONDS = 1448911495.484366
1059
- NOW = datetime.datetime.utcfromtimestamp(NOW_SECONDS).replace(tzinfo=UTC)
1065
+ NOW = datetime.datetime.fromtimestamp(NOW_SECONDS, datetime.timezone.utc)
1060
1066
  ROWS = [
1061
1067
  ("Phred Phlyntstone", 32, NOW),
1062
1068
  ("Bharney Rhubble", 33, NOW + datetime.timedelta(seconds=10)),
@@ -1304,9 +1310,14 @@ class TestBigQuery(unittest.TestCase):
1304
1310
 
1305
1311
  table_schema = Config.CLIENT.schema_from_json(DATA_PATH / "pico_schema.json")
1306
1312
  # create the table before loading so that the column order is predictable
1307
- table = helpers.retry_403(Config.CLIENT.create_table)(
1308
- Table(table_id, schema=table_schema)
1309
- )
1313
+ try:
1314
+ table = helpers.retry_403(Config.CLIENT.create_table)(
1315
+ Table(table_id, schema=table_schema)
1316
+ )
1317
+ except BadRequest as exc:
1318
+ if "picosecond precision" in str(exc):
1319
+ self.skipTest("Picosecond precision not supported in this environment")
1320
+ raise exc
1310
1321
  self.to_delete.insert(0, table)
1311
1322
 
1312
1323
  # do not pass an explicit job config to trigger automatic schema detection
@@ -1844,7 +1855,9 @@ class TestBigQuery(unittest.TestCase):
1844
1855
  job_config.query_parameters = [PARAM]
1845
1856
 
1846
1857
  with self.assertRaises(BadRequest):
1847
- Config.CLIENT.query(QUERY, job_id=JOB_ID, job_config=job_config).result()
1858
+ Config.CLIENT.query(
1859
+ QUERY, job_id=JOB_ID, job_config=job_config, job_retry=None
1860
+ ).result()
1848
1861
 
1849
1862
  job = Config.CLIENT.get_job(JOB_ID)
1850
1863
 
@@ -2137,7 +2150,7 @@ class TestBigQuery(unittest.TestCase):
2137
2150
  def test_dbapi_connection_does_not_leak_sockets(self):
2138
2151
  pytest.importorskip("google.cloud.bigquery_storage")
2139
2152
  current_process = psutil.Process()
2140
- conn_count_start = len(current_process.connections())
2153
+ conn_count_start = len(current_process.net_connections())
2141
2154
 
2142
2155
  # Provide no explicit clients, so that the connection will create and own them.
2143
2156
  connection = dbapi.connect()
@@ -2155,7 +2168,7 @@ class TestBigQuery(unittest.TestCase):
2155
2168
  self.assertEqual(len(rows), 100000)
2156
2169
 
2157
2170
  connection.close()
2158
- conn_count_end = len(current_process.connections())
2171
+ conn_count_end = len(current_process.net_connections())
2159
2172
  self.assertLessEqual(conn_count_end, conn_count_start)
2160
2173
 
2161
2174
  def _load_table_for_dml(self, rows, dataset_id, table_id):
@@ -48,7 +48,7 @@ def ipython_interactive(ipython):
48
48
  def test_bigquery_magic(ipython_interactive):
49
49
  ip = IPython.get_ipython()
50
50
  current_process = psutil.Process()
51
- conn_count_start = len(current_process.connections())
51
+ conn_count_start = len(current_process.net_connections())
52
52
 
53
53
  # Deprecated, but should still work in google-cloud-bigquery 3.x.
54
54
  with pytest.warns(FutureWarning, match="bigquery_magics"):
@@ -68,7 +68,7 @@ def test_bigquery_magic(ipython_interactive):
68
68
  with io.capture_output() as captured:
69
69
  result = ip.run_cell_magic("bigquery", "--use_rest_api", sql)
70
70
 
71
- conn_count_end = len(current_process.connections())
71
+ conn_count_end = len(current_process.net_connections())
72
72
 
73
73
  lines = re.split("\n|\r", captured.stdout)
74
74
  # Removes blanks & terminal code (result of display clearing)
@@ -1155,7 +1155,7 @@ def test_list_rows_nullable_scalars_extreme_dtypes(
1155
1155
 
1156
1156
  # pandas uses Python string and bytes objects.
1157
1157
  assert df.dtypes["bytes_col"].name == "object"
1158
- assert df.dtypes["string_col"].name == "object"
1158
+ assert df.dtypes["string_col"].name in {"object", "string", "str", "O"}
1159
1159
 
1160
1160
 
1161
1161
  @pytest.mark.parametrize(
@@ -550,11 +550,18 @@ def test_session(bigquery_client: bigquery.Client, query_api_method: str):
550
550
 
551
551
 
552
552
  def test_query_picosecond(bigquery_client: bigquery.Client):
553
- job = bigquery_client.query(
554
- "SELECT CAST('2025-10-20' AS TIMESTAMP(12));",
555
- api_method="QUERY",
556
- timestamp_precision=enums.TimestampPrecision.PICOSECOND,
557
- )
553
+ try:
554
+ job = bigquery_client.query(
555
+ "SELECT CAST('2025-10-20' AS TIMESTAMP(12));",
556
+ api_method="QUERY",
557
+ timestamp_precision=enums.TimestampPrecision.PICOSECOND,
558
+ )
559
+ except exceptions.BadRequest as exc:
560
+ if "timestamp_output_format" in str(exc):
561
+ pytest.skip(
562
+ "Timestamp output format not supported or parameter invalid for this environment"
563
+ )
564
+ raise exc
558
565
 
559
566
  result = job.result()
560
567
  rows = list(result)
@@ -26,8 +26,6 @@ JOB_ID = "test-job-id"
26
26
 
27
27
 
28
28
  def test_cancel_w_custom_retry(global_time_lock):
29
- from google.cloud.bigquery.retry import DEFAULT_RETRY
30
-
31
29
  api_path = "/projects/{}/jobs/{}/cancel".format(PROJECT, JOB_ID)
32
30
  resource = {
33
31
  "jobReference": {
@@ -49,8 +47,11 @@ def test_cancel_w_custom_retry(global_time_lock):
49
47
  google.cloud.bigquery.job._JobReference(JOB_ID, PROJECT, "EU"), client
50
48
  )
51
49
 
52
- retry = DEFAULT_RETRY.with_deadline(1).with_predicate(
53
- lambda exc: isinstance(exc, ValueError)
50
+ retry = google.api_core.retry.Retry(
51
+ predicate=lambda exc: isinstance(exc, ValueError),
52
+ initial=0.01,
53
+ maximum=0.01,
54
+ deadline=1.0,
54
55
  )
55
56
 
56
57
  with mock.patch(
@@ -680,6 +680,55 @@ class TestQueryJob(_Base):
680
680
  self.assertEqual(remote.dataset_id, "other-dataset")
681
681
  self.assertEqual(remote.project, "other-project-123")
682
682
 
683
+ def test_referenced_property_graphs(self):
684
+ from google.cloud.bigquery.table import PropertyGraphReference
685
+
686
+ ref_pg_resource = [
687
+ {
688
+ "projectId": self.PROJECT,
689
+ "datasetId": "dataset",
690
+ "propertyGraphId": "pg1",
691
+ },
692
+ {
693
+ "projectId": self.PROJECT,
694
+ "datasetId": "dataset",
695
+ "propertyGraphId": "pg2",
696
+ },
697
+ {
698
+ "projectId": "other-project-123",
699
+ "datasetId": "other-dataset",
700
+ "propertyGraphId": "other-pg",
701
+ },
702
+ ]
703
+ client = _make_client(project=self.PROJECT)
704
+ job = self._make_one(self.JOB_ID, self.QUERY, client)
705
+ self.assertEqual(job.referenced_property_graphs, [])
706
+
707
+ statistics = job._properties["statistics"] = {}
708
+ self.assertEqual(job.referenced_property_graphs, [])
709
+
710
+ query_stats = statistics["query"] = {}
711
+ self.assertEqual(job.referenced_property_graphs, [])
712
+
713
+ query_stats["referencedPropertyGraphs"] = ref_pg_resource
714
+
715
+ pg1, pg2, remote = job.referenced_property_graphs
716
+
717
+ self.assertIsInstance(pg1, PropertyGraphReference)
718
+ self.assertEqual(pg1.property_graph_id, "pg1")
719
+ self.assertEqual(pg1.dataset_id, "dataset")
720
+ self.assertEqual(pg1.project, self.PROJECT)
721
+
722
+ self.assertIsInstance(pg2, PropertyGraphReference)
723
+ self.assertEqual(pg2.property_graph_id, "pg2")
724
+ self.assertEqual(pg2.dataset_id, "dataset")
725
+ self.assertEqual(pg2.project, self.PROJECT)
726
+
727
+ self.assertIsInstance(remote, PropertyGraphReference)
728
+ self.assertEqual(remote.property_graph_id, "other-pg")
729
+ self.assertEqual(remote.dataset_id, "other-dataset")
730
+ self.assertEqual(remote.project, "other-project-123")
731
+
683
732
  def test_timeline(self):
684
733
  timeline_resource = [
685
734
  {
@@ -707,11 +707,11 @@ def test_to_dataframe_column_dtypes():
707
707
  assert df.seconds.dtype.name == "Int64"
708
708
  assert df.miles.dtype.name == "float64"
709
709
  assert df.km.dtype.name == "float16"
710
- assert df.payment_type.dtype.name == "object"
710
+ assert df.payment_type.dtype.name in {"object", "string", "str", "O"}
711
711
  assert df.complete.dtype.name == "boolean"
712
712
  assert df.date.dtype.name == "dbdate"
713
713
 
714
- if pandas.__version__.startswith("2."):
714
+ if pandas.__version__.startswith(("2.", "3.")):
715
715
  assert df.start_timestamp.dtype.name == "datetime64[us, UTC]"
716
716
  else:
717
717
  assert df.start_timestamp.dtype.name == "datetime64[ns, UTC]"
@@ -851,12 +851,16 @@ def test_list_columns_and_indexes_without_named_index(module_under_test):
851
851
  dataframe = pandas.DataFrame(df_data)
852
852
 
853
853
  columns_and_indexes = module_under_test.list_columns_and_indexes(dataframe)
854
- expected = [
854
+ expected_stable_types = [
855
855
  ("a_series", pandas.api.types.pandas_dtype("int64")),
856
856
  ("b_series", pandas.api.types.pandas_dtype("float64")),
857
- ("c_series", pandas.api.types.pandas_dtype("object")),
858
857
  ]
859
- assert columns_and_indexes == expected
858
+ assert columns_and_indexes[:-1] == expected_stable_types
859
+
860
+ # The last column is string/object, which varies by pandas/pyarrow version
861
+ string_col_name, string_col_dtype = columns_and_indexes[-1]
862
+ assert string_col_name == "c_series"
863
+ assert string_col_dtype.name in {"object", "string", "str", "O"}
860
864
 
861
865
 
862
866
  @pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
@@ -878,12 +882,16 @@ def test_list_columns_and_indexes_with_named_index_same_as_column_name(
878
882
  )
879
883
 
880
884
  columns_and_indexes = module_under_test.list_columns_and_indexes(dataframe)
881
- expected = [
885
+ expected_stable_types = [
882
886
  ("a_series", pandas.api.types.pandas_dtype("int64")),
883
887
  ("b_series", pandas.api.types.pandas_dtype("float64")),
884
- ("c_series", pandas.api.types.pandas_dtype("object")),
885
888
  ]
886
- assert columns_and_indexes == expected
889
+ assert columns_and_indexes[:-1] == expected_stable_types
890
+
891
+ # The last column is string/object, which varies by pandas/pyarrow version
892
+ string_col_name, string_col_dtype = columns_and_indexes[-1]
893
+ assert string_col_name == "c_series"
894
+ assert string_col_dtype.name in {"object", "string", "str", "O"}
887
895
 
888
896
 
889
897
  @pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
@@ -986,13 +994,19 @@ def test_list_columns_and_indexes_with_named_index(module_under_test):
986
994
  )
987
995
 
988
996
  columns_and_indexes = module_under_test.list_columns_and_indexes(dataframe)
989
- expected = [
997
+
998
+ # First few columns have stable types (int, float)
999
+ expected_stable_types = [
990
1000
  ("a_index", pandas.api.types.pandas_dtype("int64")),
991
1001
  ("a_series", pandas.api.types.pandas_dtype("int64")),
992
1002
  ("b_series", pandas.api.types.pandas_dtype("float64")),
993
- ("c_series", pandas.api.types.pandas_dtype("object")),
994
1003
  ]
995
- assert columns_and_indexes == expected
1004
+ assert columns_and_indexes[:-1] == expected_stable_types
1005
+
1006
+ # The last column is string/object, which varies by pandas/pyarrow version
1007
+ string_col_name, string_col_dtype = columns_and_indexes[-1]
1008
+ assert string_col_name == "c_series"
1009
+ assert string_col_dtype.name in {"object", "string", "str", "O"}
996
1010
 
997
1011
 
998
1012
  @pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
@@ -1019,14 +1033,20 @@ def test_list_columns_and_indexes_with_multiindex(module_under_test):
1019
1033
  )
1020
1034
 
1021
1035
  columns_and_indexes = module_under_test.list_columns_and_indexes(dataframe)
1022
- expected = [
1036
+
1037
+ # First few columns have stable types (int, float)
1038
+ expected_stable_types = [
1023
1039
  ("a_index", pandas.api.types.pandas_dtype("int64")),
1024
1040
  ("c_index", pandas.api.types.pandas_dtype("int64")),
1025
1041
  ("a_series", pandas.api.types.pandas_dtype("int64")),
1026
1042
  ("b_series", pandas.api.types.pandas_dtype("float64")),
1027
- ("c_series", pandas.api.types.pandas_dtype("object")),
1028
1043
  ]
1029
- assert columns_and_indexes == expected
1044
+ assert columns_and_indexes[:-1] == expected_stable_types
1045
+
1046
+ # The last column is string/object, which varies by pandas/pyarrow version
1047
+ string_col_name, string_col_dtype = columns_and_indexes[-1]
1048
+ assert string_col_name == "c_series"
1049
+ assert string_col_dtype.name in {"object", "string", "str", "O"}
1030
1050
 
1031
1051
 
1032
1052
  @pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
@@ -1345,15 +1365,21 @@ def test_dataframe_to_bq_schema_w_multiindex(module_under_test, monkeypatch):
1345
1365
  with pytest.warns(FutureWarning, match="pandas-gbq"):
1346
1366
  returned_schema = module_under_test.dataframe_to_bq_schema(dataframe, [])
1347
1367
 
1348
- expected_schema = (
1349
- schema.SchemaField("str_index", "STRING", "NULLABLE"),
1350
- schema.SchemaField("int_index", "INTEGER", "NULLABLE"),
1351
- schema.SchemaField("dt_index", "DATETIME", "NULLABLE"),
1352
- schema.SchemaField("str_column", "STRING", "NULLABLE"),
1353
- schema.SchemaField("int_column", "INTEGER", "NULLABLE"),
1354
- schema.SchemaField("bool_column", "BOOLEAN", "NULLABLE"),
1368
+ # dt_index can be DATETIME or TIMESTAMP depending on pandas version/environment
1369
+ # We check the stable columns first
1370
+ assert returned_schema[0] == schema.SchemaField("str_index", "STRING", "NULLABLE")
1371
+ assert returned_schema[1] == schema.SchemaField("int_index", "INTEGER", "NULLABLE")
1372
+
1373
+ # Flexible check for dt_index
1374
+ assert returned_schema[2].name == "dt_index"
1375
+ assert returned_schema[2].field_type in {"DATETIME", "TIMESTAMP"}
1376
+ assert returned_schema[2].mode == "NULLABLE"
1377
+
1378
+ assert returned_schema[3] == schema.SchemaField("str_column", "STRING", "NULLABLE")
1379
+ assert returned_schema[4] == schema.SchemaField("int_column", "INTEGER", "NULLABLE")
1380
+ assert returned_schema[5] == schema.SchemaField(
1381
+ "bool_column", "BOOLEAN", "NULLABLE"
1355
1382
  )
1356
- assert returned_schema == expected_schema
1357
1383
 
1358
1384
 
1359
1385
  @pytest.mark.skipif(pandas is None, reason="Requires `pandas`")