google-cloud-bigquery 3.40.0__tar.gz → 3.40.1__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.
- {google_cloud_bigquery-3.40.0/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.40.1}/PKG-INFO +1 -1
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/_pandas_helpers.py +113 -58
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/client.py +5 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/dbapi/cursor.py +2 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/job/query.py +17 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/retry.py +11 -5
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/table.py +45 -5
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/version.py +1 -1
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1/google_cloud_bigquery.egg-info}/PKG-INFO +1 -1
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_query_pandas.py +39 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test__pandas_helpers.py +206 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_client_retry.py +6 -1
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_dbapi_cursor.py +5 -1
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_table.py +23 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_table_pandas.py +2 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/LICENSE +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/MANIFEST.in +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/README.rst +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/_http.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/_job_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/_versions_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/dataset.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/dbapi/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/dbapi/connection.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/dbapi/types.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/encryption_configuration.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/enums.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/exceptions.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/external_config.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/format_options.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/iam.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/job/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/job/base.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/job/copy_.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/job/extract.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/job/load.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/magics/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/magics/magics.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/model.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/py.typed +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/query.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/routine/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/routine/routine.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/schema.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/standard_sql.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery_v2/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery_v2/types/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery_v2/types/model.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google_cloud_bigquery.egg-info/SOURCES.txt +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google_cloud_bigquery.egg-info/requires.txt +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/pyproject.toml +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/setup.cfg +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/setup.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/characters.json +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/characters.jsonl +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/colors.avro +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/numeric_38_12.parquet +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/people.csv +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/pico.csv +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/pico_schema.json +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/scalars.csv +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/scalars.jsonl +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/scalars_extreme.jsonl +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/scalars_schema.json +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/scalars_schema_csv.json +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/data/schema.json +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/scrub_datasets.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/conftest.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_arrow.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_client.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_job_retry.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_list_rows.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_magics.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_pandas.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_query.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/system/test_structs.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/_helpers/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/_helpers/test_cell_data_parser.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/_helpers/test_data_frame_cell_data_parser.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/_helpers/test_scalar_query_param_parser.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/conftest.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_async_job_retry.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_base.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_copy.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_extract.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_load.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_load_config.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_query.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_query_config.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_query_job_retry.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/job/test_query_stats.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/line_arg_parser/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/line_arg_parser/test_lexer.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/line_arg_parser/test_parser.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/line_arg_parser/test_visitors.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/model/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/model/test_model.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/model/test_model_reference.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/routine/__init__.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/routine/test_external_runtime_options.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/routine/test_remote_function_options.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/routine/test_routine.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/routine/test_routine_argument.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/routine/test_routine_reference.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test__helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test__http.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test__job_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test__job_helpers_retry.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test__pyarrow_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test__versions_helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_client.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_client_bigframes.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_client_resumable_media_upload.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_create_dataset.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_dataset.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_dbapi__helpers.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_dbapi_connection.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_dbapi_types.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_delete_dataset.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_encryption_configuration.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_external_config.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_format_options.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_job_retry.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_legacy_types.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_list_datasets.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_list_jobs.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_list_models.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_list_projects.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_list_routines.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_list_tables.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_magics.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_opentelemetry_tracing.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_packaging.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_query.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_retry.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_schema.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_signature_compatibility.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_standard_sql_types.py +0 -0
- {google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/tests/unit/test_table_arrow.py +0 -0
|
@@ -26,12 +26,14 @@ from itertools import islice
|
|
|
26
26
|
import logging
|
|
27
27
|
import queue
|
|
28
28
|
import threading
|
|
29
|
+
import time
|
|
29
30
|
import warnings
|
|
30
31
|
from typing import Any, Union, Optional, Callable, Generator, List
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
from google.cloud.bigquery import _pyarrow_helpers
|
|
34
35
|
from google.cloud.bigquery import _versions_helpers
|
|
36
|
+
from google.cloud.bigquery import retry as bq_retry
|
|
35
37
|
from google.cloud.bigquery import schema
|
|
36
38
|
|
|
37
39
|
|
|
@@ -739,7 +741,7 @@ def _row_iterator_page_to_arrow(page, column_names, arrow_types):
|
|
|
739
741
|
return pyarrow.RecordBatch.from_arrays(arrays, names=column_names)
|
|
740
742
|
|
|
741
743
|
|
|
742
|
-
def download_arrow_row_iterator(pages, bq_schema):
|
|
744
|
+
def download_arrow_row_iterator(pages, bq_schema, timeout=None):
|
|
743
745
|
"""Use HTTP JSON RowIterator to construct an iterable of RecordBatches.
|
|
744
746
|
|
|
745
747
|
Args:
|
|
@@ -750,6 +752,10 @@ def download_arrow_row_iterator(pages, bq_schema):
|
|
|
750
752
|
Mapping[str, Any] \
|
|
751
753
|
]]):
|
|
752
754
|
A decription of the fields in result pages.
|
|
755
|
+
timeout (Optional[float]):
|
|
756
|
+
The number of seconds to wait for the underlying download to complete.
|
|
757
|
+
If ``None``, wait indefinitely.
|
|
758
|
+
|
|
753
759
|
Yields:
|
|
754
760
|
:class:`pyarrow.RecordBatch`
|
|
755
761
|
The next page of records as a ``pyarrow`` record batch.
|
|
@@ -758,8 +764,16 @@ def download_arrow_row_iterator(pages, bq_schema):
|
|
|
758
764
|
column_names = bq_to_arrow_schema(bq_schema) or [field.name for field in bq_schema]
|
|
759
765
|
arrow_types = [bq_to_arrow_data_type(field) for field in bq_schema]
|
|
760
766
|
|
|
761
|
-
|
|
762
|
-
|
|
767
|
+
if timeout is None:
|
|
768
|
+
for page in pages:
|
|
769
|
+
yield _row_iterator_page_to_arrow(page, column_names, arrow_types)
|
|
770
|
+
else:
|
|
771
|
+
start_time = time.monotonic()
|
|
772
|
+
for page in pages:
|
|
773
|
+
if time.monotonic() - start_time > timeout:
|
|
774
|
+
raise concurrent.futures.TimeoutError()
|
|
775
|
+
|
|
776
|
+
yield _row_iterator_page_to_arrow(page, column_names, arrow_types)
|
|
763
777
|
|
|
764
778
|
|
|
765
779
|
def _row_iterator_page_to_dataframe(page, column_names, dtypes):
|
|
@@ -777,7 +791,7 @@ def _row_iterator_page_to_dataframe(page, column_names, dtypes):
|
|
|
777
791
|
return pandas.DataFrame(columns, columns=column_names)
|
|
778
792
|
|
|
779
793
|
|
|
780
|
-
def download_dataframe_row_iterator(pages, bq_schema, dtypes):
|
|
794
|
+
def download_dataframe_row_iterator(pages, bq_schema, dtypes, timeout=None):
|
|
781
795
|
"""Use HTTP JSON RowIterator to construct a DataFrame.
|
|
782
796
|
|
|
783
797
|
Args:
|
|
@@ -791,14 +805,27 @@ def download_dataframe_row_iterator(pages, bq_schema, dtypes):
|
|
|
791
805
|
dtypes(Mapping[str, numpy.dtype]):
|
|
792
806
|
The types of columns in result data to hint construction of the
|
|
793
807
|
resulting DataFrame. Not all column types have to be specified.
|
|
808
|
+
timeout (Optional[float]):
|
|
809
|
+
The number of seconds to wait for the underlying download to complete.
|
|
810
|
+
If ``None``, wait indefinitely.
|
|
811
|
+
|
|
794
812
|
Yields:
|
|
795
813
|
:class:`pandas.DataFrame`
|
|
796
814
|
The next page of records as a ``pandas.DataFrame`` record batch.
|
|
797
815
|
"""
|
|
798
816
|
bq_schema = schema._to_schema_fields(bq_schema)
|
|
799
817
|
column_names = [field.name for field in bq_schema]
|
|
800
|
-
|
|
801
|
-
|
|
818
|
+
|
|
819
|
+
if timeout is None:
|
|
820
|
+
for page in pages:
|
|
821
|
+
yield _row_iterator_page_to_dataframe(page, column_names, dtypes)
|
|
822
|
+
else:
|
|
823
|
+
start_time = time.monotonic()
|
|
824
|
+
for page in pages:
|
|
825
|
+
if time.monotonic() - start_time > timeout:
|
|
826
|
+
raise concurrent.futures.TimeoutError()
|
|
827
|
+
|
|
828
|
+
yield _row_iterator_page_to_dataframe(page, column_names, dtypes)
|
|
802
829
|
|
|
803
830
|
|
|
804
831
|
def _bqstorage_page_to_arrow(page):
|
|
@@ -869,6 +896,7 @@ def _download_table_bqstorage(
|
|
|
869
896
|
max_queue_size: Any = _MAX_QUEUE_SIZE_DEFAULT,
|
|
870
897
|
max_stream_count: Optional[int] = None,
|
|
871
898
|
download_state: Optional[_DownloadState] = None,
|
|
899
|
+
timeout: Optional[float] = None,
|
|
872
900
|
) -> Generator[Any, None, None]:
|
|
873
901
|
"""Downloads a BigQuery table using the BigQuery Storage API.
|
|
874
902
|
|
|
@@ -899,6 +927,9 @@ def _download_table_bqstorage(
|
|
|
899
927
|
download_state (Optional[_DownloadState]):
|
|
900
928
|
A threadsafe state object which can be used to observe the
|
|
901
929
|
behavior of the worker threads created by this method.
|
|
930
|
+
timeout (Optional[float]):
|
|
931
|
+
The number of seconds to wait for the download to complete.
|
|
932
|
+
If None, wait indefinitely.
|
|
902
933
|
|
|
903
934
|
Yields:
|
|
904
935
|
pandas.DataFrame: Pandas DataFrames, one for each chunk of data
|
|
@@ -906,6 +937,8 @@ def _download_table_bqstorage(
|
|
|
906
937
|
|
|
907
938
|
Raises:
|
|
908
939
|
ValueError: If attempting to read from a specific partition or snapshot.
|
|
940
|
+
concurrent.futures.TimeoutError:
|
|
941
|
+
If the download does not complete within the specified timeout.
|
|
909
942
|
|
|
910
943
|
Note:
|
|
911
944
|
This method requires the `google-cloud-bigquery-storage` library
|
|
@@ -921,6 +954,7 @@ def _download_table_bqstorage(
|
|
|
921
954
|
if "@" in table.table_id:
|
|
922
955
|
raise ValueError("Reading from a specific snapshot is not currently supported.")
|
|
923
956
|
|
|
957
|
+
start_time = time.monotonic()
|
|
924
958
|
requested_streams = determine_requested_streams(preserve_order, max_stream_count)
|
|
925
959
|
|
|
926
960
|
requested_session = bigquery_storage.types.stream.ReadSession(
|
|
@@ -937,10 +971,16 @@ def _download_table_bqstorage(
|
|
|
937
971
|
ArrowSerializationOptions.CompressionCodec(1)
|
|
938
972
|
)
|
|
939
973
|
|
|
974
|
+
retry_policy = (
|
|
975
|
+
bq_retry.DEFAULT_RETRY.with_deadline(timeout) if timeout is not None else None
|
|
976
|
+
)
|
|
977
|
+
|
|
940
978
|
session = bqstorage_client.create_read_session(
|
|
941
979
|
parent="projects/{}".format(project_id),
|
|
942
980
|
read_session=requested_session,
|
|
943
981
|
max_stream_count=requested_streams,
|
|
982
|
+
retry=retry_policy,
|
|
983
|
+
timeout=timeout,
|
|
944
984
|
)
|
|
945
985
|
|
|
946
986
|
_LOGGER.debug(
|
|
@@ -973,60 +1013,71 @@ def _download_table_bqstorage(
|
|
|
973
1013
|
|
|
974
1014
|
worker_queue: queue.Queue[int] = queue.Queue(maxsize=max_queue_size)
|
|
975
1015
|
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1016
|
+
# Manually manage the pool to control shutdown behavior on timeout.
|
|
1017
|
+
pool = concurrent.futures.ThreadPoolExecutor(max_workers=max(1, total_streams))
|
|
1018
|
+
wait_on_shutdown = True
|
|
1019
|
+
try:
|
|
1020
|
+
# Manually submit jobs and wait for download to complete rather
|
|
1021
|
+
# than using pool.map because pool.map continues running in the
|
|
1022
|
+
# background even if there is an exception on the main thread.
|
|
1023
|
+
# See: https://github.com/googleapis/google-cloud-python/pull/7698
|
|
1024
|
+
not_done = [
|
|
1025
|
+
pool.submit(
|
|
1026
|
+
_download_table_bqstorage_stream,
|
|
1027
|
+
download_state,
|
|
1028
|
+
bqstorage_client,
|
|
1029
|
+
session,
|
|
1030
|
+
stream,
|
|
1031
|
+
worker_queue,
|
|
1032
|
+
page_to_item,
|
|
1033
|
+
)
|
|
1034
|
+
for stream in session.streams
|
|
1035
|
+
]
|
|
1036
|
+
|
|
1037
|
+
while not_done:
|
|
1038
|
+
# Check for timeout
|
|
1039
|
+
if timeout is not None:
|
|
1040
|
+
elapsed = time.monotonic() - start_time
|
|
1041
|
+
if elapsed > timeout:
|
|
1042
|
+
wait_on_shutdown = False
|
|
1043
|
+
raise concurrent.futures.TimeoutError(
|
|
1044
|
+
f"Download timed out after {timeout} seconds."
|
|
1045
|
+
)
|
|
1046
|
+
|
|
1047
|
+
# Don't block on the worker threads. For performance reasons,
|
|
1048
|
+
# we want to block on the queue's get method, instead. This
|
|
1049
|
+
# prevents the queue from filling up, because the main thread
|
|
1050
|
+
# has smaller gaps in time between calls to the queue's get
|
|
1051
|
+
# method. For a detailed explanation, see:
|
|
1052
|
+
# https://friendliness.dev/2019/06/18/python-nowait/
|
|
1053
|
+
done, not_done = _nowait(not_done)
|
|
1054
|
+
for future in done:
|
|
1055
|
+
# Call result() on any finished threads to raise any
|
|
1056
|
+
# exceptions encountered.
|
|
1057
|
+
future.result()
|
|
1058
|
+
|
|
1059
|
+
try:
|
|
1060
|
+
frame = worker_queue.get(timeout=_PROGRESS_INTERVAL)
|
|
1061
|
+
yield frame
|
|
1062
|
+
except queue.Empty: # pragma: NO COVER
|
|
1063
|
+
continue
|
|
1013
1064
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1065
|
+
# Return any remaining values after the workers finished.
|
|
1066
|
+
while True: # pragma: NO COVER
|
|
1067
|
+
try:
|
|
1068
|
+
frame = worker_queue.get_nowait()
|
|
1069
|
+
yield frame
|
|
1070
|
+
except queue.Empty: # pragma: NO COVER
|
|
1071
|
+
break
|
|
1072
|
+
finally:
|
|
1073
|
+
# No need for a lock because reading/replacing a variable is
|
|
1074
|
+
# defined to be an atomic operation in the Python language
|
|
1075
|
+
# definition (enforced by the global interpreter lock).
|
|
1076
|
+
download_state.done = True
|
|
1026
1077
|
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1078
|
+
# Shutdown all background threads, now that they should know to
|
|
1079
|
+
# exit early.
|
|
1080
|
+
pool.shutdown(wait=wait_on_shutdown)
|
|
1030
1081
|
|
|
1031
1082
|
|
|
1032
1083
|
def download_arrow_bqstorage(
|
|
@@ -1037,6 +1088,7 @@ def download_arrow_bqstorage(
|
|
|
1037
1088
|
selected_fields=None,
|
|
1038
1089
|
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
1039
1090
|
max_stream_count=None,
|
|
1091
|
+
timeout=None,
|
|
1040
1092
|
):
|
|
1041
1093
|
return _download_table_bqstorage(
|
|
1042
1094
|
project_id,
|
|
@@ -1047,6 +1099,7 @@ def download_arrow_bqstorage(
|
|
|
1047
1099
|
page_to_item=_bqstorage_page_to_arrow,
|
|
1048
1100
|
max_queue_size=max_queue_size,
|
|
1049
1101
|
max_stream_count=max_stream_count,
|
|
1102
|
+
timeout=timeout,
|
|
1050
1103
|
)
|
|
1051
1104
|
|
|
1052
1105
|
|
|
@@ -1060,6 +1113,7 @@ def download_dataframe_bqstorage(
|
|
|
1060
1113
|
selected_fields=None,
|
|
1061
1114
|
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
1062
1115
|
max_stream_count=None,
|
|
1116
|
+
timeout=None,
|
|
1063
1117
|
):
|
|
1064
1118
|
page_to_item = functools.partial(_bqstorage_page_to_dataframe, column_names, dtypes)
|
|
1065
1119
|
return _download_table_bqstorage(
|
|
@@ -1071,6 +1125,7 @@ def download_dataframe_bqstorage(
|
|
|
1071
1125
|
page_to_item=page_to_item,
|
|
1072
1126
|
max_queue_size=max_queue_size,
|
|
1073
1127
|
max_stream_count=max_stream_count,
|
|
1128
|
+
timeout=timeout,
|
|
1074
1129
|
)
|
|
1075
1130
|
|
|
1076
1131
|
|
{google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/client.py
RENAMED
|
@@ -3655,6 +3655,11 @@ class Client(ClientWithProject):
|
|
|
3655
3655
|
page_size (Optional[int]):
|
|
3656
3656
|
The maximum number of rows in each page of results from the
|
|
3657
3657
|
initial jobs.query request. Non-positive values are ignored.
|
|
3658
|
+
|
|
3659
|
+
This parameter only affects the jobs.query and
|
|
3660
|
+
jobs.getQueryResults API calls. Large results downloaded with
|
|
3661
|
+
the BigQuery Storage Read API are intentionally unaffected
|
|
3662
|
+
by this parameter.
|
|
3658
3663
|
max_results (Optional[int]):
|
|
3659
3664
|
The maximum total number of rows from this request.
|
|
3660
3665
|
|
{google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/job/query.py
RENAMED
|
@@ -1857,6 +1857,7 @@ class QueryJob(_AsyncJob):
|
|
|
1857
1857
|
bqstorage_client: Optional["bigquery_storage.BigQueryReadClient"] = None,
|
|
1858
1858
|
create_bqstorage_client: bool = True,
|
|
1859
1859
|
max_results: Optional[int] = None,
|
|
1860
|
+
timeout: Optional[float] = None,
|
|
1860
1861
|
) -> "pyarrow.Table":
|
|
1861
1862
|
"""[Beta] Create a class:`pyarrow.Table` by loading all pages of a
|
|
1862
1863
|
table or query.
|
|
@@ -1904,6 +1905,10 @@ class QueryJob(_AsyncJob):
|
|
|
1904
1905
|
|
|
1905
1906
|
.. versionadded:: 2.21.0
|
|
1906
1907
|
|
|
1908
|
+
timeout (Optional[float]):
|
|
1909
|
+
The number of seconds to wait for the underlying download to complete.
|
|
1910
|
+
If ``None``, wait indefinitely.
|
|
1911
|
+
|
|
1907
1912
|
Returns:
|
|
1908
1913
|
pyarrow.Table
|
|
1909
1914
|
A :class:`pyarrow.Table` populated with row data and column
|
|
@@ -1921,6 +1926,7 @@ class QueryJob(_AsyncJob):
|
|
|
1921
1926
|
progress_bar_type=progress_bar_type,
|
|
1922
1927
|
bqstorage_client=bqstorage_client,
|
|
1923
1928
|
create_bqstorage_client=create_bqstorage_client,
|
|
1929
|
+
timeout=timeout,
|
|
1924
1930
|
)
|
|
1925
1931
|
|
|
1926
1932
|
# If changing the signature of this method, make sure to apply the same
|
|
@@ -1949,6 +1955,7 @@ class QueryJob(_AsyncJob):
|
|
|
1949
1955
|
range_timestamp_dtype: Union[
|
|
1950
1956
|
Any, None
|
|
1951
1957
|
] = DefaultPandasDTypes.RANGE_TIMESTAMP_DTYPE,
|
|
1958
|
+
timeout: Optional[float] = None,
|
|
1952
1959
|
) -> "pandas.DataFrame":
|
|
1953
1960
|
"""Return a pandas DataFrame from a QueryJob
|
|
1954
1961
|
|
|
@@ -2141,6 +2148,10 @@ class QueryJob(_AsyncJob):
|
|
|
2141
2148
|
|
|
2142
2149
|
.. versionadded:: 3.21.0
|
|
2143
2150
|
|
|
2151
|
+
timeout (Optional[float]):
|
|
2152
|
+
The number of seconds to wait for the underlying download to complete.
|
|
2153
|
+
If ``None``, wait indefinitely.
|
|
2154
|
+
|
|
2144
2155
|
Returns:
|
|
2145
2156
|
pandas.DataFrame:
|
|
2146
2157
|
A :class:`~pandas.DataFrame` populated with row data
|
|
@@ -2174,6 +2185,7 @@ class QueryJob(_AsyncJob):
|
|
|
2174
2185
|
range_date_dtype=range_date_dtype,
|
|
2175
2186
|
range_datetime_dtype=range_datetime_dtype,
|
|
2176
2187
|
range_timestamp_dtype=range_timestamp_dtype,
|
|
2188
|
+
timeout=timeout,
|
|
2177
2189
|
)
|
|
2178
2190
|
|
|
2179
2191
|
# If changing the signature of this method, make sure to apply the same
|
|
@@ -2191,6 +2203,7 @@ class QueryJob(_AsyncJob):
|
|
|
2191
2203
|
int_dtype: Union[Any, None] = DefaultPandasDTypes.INT_DTYPE,
|
|
2192
2204
|
float_dtype: Union[Any, None] = None,
|
|
2193
2205
|
string_dtype: Union[Any, None] = None,
|
|
2206
|
+
timeout: Optional[float] = None,
|
|
2194
2207
|
) -> "geopandas.GeoDataFrame":
|
|
2195
2208
|
"""Return a GeoPandas GeoDataFrame from a QueryJob
|
|
2196
2209
|
|
|
@@ -2269,6 +2282,9 @@ class QueryJob(_AsyncJob):
|
|
|
2269
2282
|
then the data type will be ``numpy.dtype("object")``. BigQuery String
|
|
2270
2283
|
type can be found at:
|
|
2271
2284
|
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#string_type
|
|
2285
|
+
timeout (Optional[float]):
|
|
2286
|
+
The number of seconds to wait for the underlying download to complete.
|
|
2287
|
+
If ``None``, wait indefinitely.
|
|
2272
2288
|
|
|
2273
2289
|
Returns:
|
|
2274
2290
|
geopandas.GeoDataFrame:
|
|
@@ -2296,6 +2312,7 @@ class QueryJob(_AsyncJob):
|
|
|
2296
2312
|
int_dtype=int_dtype,
|
|
2297
2313
|
float_dtype=float_dtype,
|
|
2298
2314
|
string_dtype=string_dtype,
|
|
2315
|
+
timeout=timeout,
|
|
2299
2316
|
)
|
|
2300
2317
|
|
|
2301
2318
|
def __iter__(self):
|
{google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/retry.py
RENAMED
|
@@ -12,12 +12,15 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
import logging
|
|
16
|
+
|
|
15
17
|
from google.api_core import exceptions
|
|
16
18
|
from google.api_core import retry
|
|
17
19
|
import google.api_core.future.polling
|
|
18
20
|
from google.auth import exceptions as auth_exceptions # type: ignore
|
|
19
21
|
import requests.exceptions
|
|
20
22
|
|
|
23
|
+
_LOGGER = logging.getLogger(__name__)
|
|
21
24
|
|
|
22
25
|
_RETRYABLE_REASONS = frozenset(
|
|
23
26
|
["rateLimitExceeded", "backendError", "internalError", "badGateway"]
|
|
@@ -61,14 +64,17 @@ _DEFAULT_JOB_DEADLINE = 2.0 * (2.0 * _DEFAULT_RETRY_DEADLINE)
|
|
|
61
64
|
def _should_retry(exc):
|
|
62
65
|
"""Predicate for determining when to retry.
|
|
63
66
|
|
|
64
|
-
We retry if and only if the 'reason' is
|
|
65
|
-
|
|
67
|
+
We retry if and only if the 'reason' is in _RETRYABLE_REASONS or is
|
|
68
|
+
in _UNSTRUCTURED_RETRYABLE_TYPES.
|
|
66
69
|
"""
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
try:
|
|
71
|
+
reason = exc.errors[0]["reason"]
|
|
72
|
+
except (AttributeError, IndexError, TypeError, KeyError):
|
|
73
|
+
# Fallback for when errors attribute is missing, empty, or not a dict
|
|
74
|
+
# or doesn't contain "reason" (e.g. gRPC exceptions).
|
|
75
|
+
_LOGGER.debug("Inspecting unstructured error for retry: %r", exc)
|
|
69
76
|
return isinstance(exc, _UNSTRUCTURED_RETRYABLE_TYPES)
|
|
70
77
|
|
|
71
|
-
reason = exc.errors[0]["reason"]
|
|
72
78
|
return reason in _RETRYABLE_REASONS
|
|
73
79
|
|
|
74
80
|
|
{google_cloud_bigquery-3.40.0 → google_cloud_bigquery-3.40.1}/google/cloud/bigquery/table.py
RENAMED
|
@@ -2087,6 +2087,7 @@ class RowIterator(HTTPIterator):
|
|
|
2087
2087
|
bqstorage_client: Optional["bigquery_storage.BigQueryReadClient"] = None,
|
|
2088
2088
|
max_queue_size: int = _pandas_helpers._MAX_QUEUE_SIZE_DEFAULT, # type: ignore
|
|
2089
2089
|
max_stream_count: Optional[int] = None,
|
|
2090
|
+
timeout: Optional[float] = None,
|
|
2090
2091
|
) -> Iterator["pyarrow.RecordBatch"]:
|
|
2091
2092
|
"""[Beta] Create an iterable of class:`pyarrow.RecordBatch`, to process the table as a stream.
|
|
2092
2093
|
|
|
@@ -2127,6 +2128,10 @@ class RowIterator(HTTPIterator):
|
|
|
2127
2128
|
setting this parameter value to a value > 0 can help
|
|
2128
2129
|
reduce system resource consumption.
|
|
2129
2130
|
|
|
2131
|
+
timeout (Optional[float]):
|
|
2132
|
+
The number of seconds to wait for the underlying download to complete.
|
|
2133
|
+
If ``None``, wait indefinitely.
|
|
2134
|
+
|
|
2130
2135
|
Returns:
|
|
2131
2136
|
pyarrow.RecordBatch:
|
|
2132
2137
|
A generator of :class:`~pyarrow.RecordBatch`.
|
|
@@ -2144,9 +2149,13 @@ class RowIterator(HTTPIterator):
|
|
|
2144
2149
|
selected_fields=self._selected_fields,
|
|
2145
2150
|
max_queue_size=max_queue_size,
|
|
2146
2151
|
max_stream_count=max_stream_count,
|
|
2152
|
+
timeout=timeout,
|
|
2147
2153
|
)
|
|
2148
2154
|
tabledata_list_download = functools.partial(
|
|
2149
|
-
_pandas_helpers.download_arrow_row_iterator,
|
|
2155
|
+
_pandas_helpers.download_arrow_row_iterator,
|
|
2156
|
+
iter(self.pages),
|
|
2157
|
+
self.schema,
|
|
2158
|
+
timeout=timeout,
|
|
2150
2159
|
)
|
|
2151
2160
|
return self._to_page_iterable(
|
|
2152
2161
|
bqstorage_download,
|
|
@@ -2161,6 +2170,7 @@ class RowIterator(HTTPIterator):
|
|
|
2161
2170
|
progress_bar_type: Optional[str] = None,
|
|
2162
2171
|
bqstorage_client: Optional["bigquery_storage.BigQueryReadClient"] = None,
|
|
2163
2172
|
create_bqstorage_client: bool = True,
|
|
2173
|
+
timeout: Optional[float] = None,
|
|
2164
2174
|
) -> "pyarrow.Table":
|
|
2165
2175
|
"""[Beta] Create a class:`pyarrow.Table` by loading all pages of a
|
|
2166
2176
|
table or query.
|
|
@@ -2202,6 +2212,9 @@ class RowIterator(HTTPIterator):
|
|
|
2202
2212
|
This argument does nothing if ``bqstorage_client`` is supplied.
|
|
2203
2213
|
|
|
2204
2214
|
.. versionadded:: 1.24.0
|
|
2215
|
+
timeout (Optional[float]):
|
|
2216
|
+
The number of seconds to wait for the underlying download to complete.
|
|
2217
|
+
If ``None``, wait indefinitely.
|
|
2205
2218
|
|
|
2206
2219
|
Returns:
|
|
2207
2220
|
pyarrow.Table
|
|
@@ -2236,7 +2249,7 @@ class RowIterator(HTTPIterator):
|
|
|
2236
2249
|
|
|
2237
2250
|
record_batches = []
|
|
2238
2251
|
for record_batch in self.to_arrow_iterable(
|
|
2239
|
-
bqstorage_client=bqstorage_client
|
|
2252
|
+
bqstorage_client=bqstorage_client, timeout=timeout
|
|
2240
2253
|
):
|
|
2241
2254
|
record_batches.append(record_batch)
|
|
2242
2255
|
|
|
@@ -2271,6 +2284,7 @@ class RowIterator(HTTPIterator):
|
|
|
2271
2284
|
dtypes: Optional[Dict[str, Any]] = None,
|
|
2272
2285
|
max_queue_size: int = _pandas_helpers._MAX_QUEUE_SIZE_DEFAULT, # type: ignore
|
|
2273
2286
|
max_stream_count: Optional[int] = None,
|
|
2287
|
+
timeout: Optional[float] = None,
|
|
2274
2288
|
) -> "pandas.DataFrame":
|
|
2275
2289
|
"""Create an iterable of pandas DataFrames, to process the table as a stream.
|
|
2276
2290
|
|
|
@@ -2317,6 +2331,10 @@ class RowIterator(HTTPIterator):
|
|
|
2317
2331
|
setting this parameter value to a value > 0 can help
|
|
2318
2332
|
reduce system resource consumption.
|
|
2319
2333
|
|
|
2334
|
+
timeout (Optional[float]):
|
|
2335
|
+
The number of seconds to wait for the underlying download to complete.
|
|
2336
|
+
If ``None``, wait indefinitely.
|
|
2337
|
+
|
|
2320
2338
|
Returns:
|
|
2321
2339
|
pandas.DataFrame:
|
|
2322
2340
|
A generator of :class:`~pandas.DataFrame`.
|
|
@@ -2344,12 +2362,14 @@ class RowIterator(HTTPIterator):
|
|
|
2344
2362
|
selected_fields=self._selected_fields,
|
|
2345
2363
|
max_queue_size=max_queue_size,
|
|
2346
2364
|
max_stream_count=max_stream_count,
|
|
2365
|
+
timeout=timeout,
|
|
2347
2366
|
)
|
|
2348
2367
|
tabledata_list_download = functools.partial(
|
|
2349
2368
|
_pandas_helpers.download_dataframe_row_iterator,
|
|
2350
2369
|
iter(self.pages),
|
|
2351
2370
|
self.schema,
|
|
2352
2371
|
dtypes,
|
|
2372
|
+
timeout=timeout,
|
|
2353
2373
|
)
|
|
2354
2374
|
return self._to_page_iterable(
|
|
2355
2375
|
bqstorage_download,
|
|
@@ -2381,6 +2401,7 @@ class RowIterator(HTTPIterator):
|
|
|
2381
2401
|
range_timestamp_dtype: Union[
|
|
2382
2402
|
Any, None
|
|
2383
2403
|
] = DefaultPandasDTypes.RANGE_TIMESTAMP_DTYPE,
|
|
2404
|
+
timeout: Optional[float] = None,
|
|
2384
2405
|
) -> "pandas.DataFrame":
|
|
2385
2406
|
"""Create a pandas DataFrame by loading all pages of a query.
|
|
2386
2407
|
|
|
@@ -2577,6 +2598,10 @@ class RowIterator(HTTPIterator):
|
|
|
2577
2598
|
|
|
2578
2599
|
.. versionadded:: 3.21.0
|
|
2579
2600
|
|
|
2601
|
+
timeout (Optional[float]):
|
|
2602
|
+
The number of seconds to wait for the underlying download to complete.
|
|
2603
|
+
If ``None``, wait indefinitely.
|
|
2604
|
+
|
|
2580
2605
|
Returns:
|
|
2581
2606
|
pandas.DataFrame:
|
|
2582
2607
|
A :class:`~pandas.DataFrame` populated with row data and column
|
|
@@ -2690,6 +2715,7 @@ class RowIterator(HTTPIterator):
|
|
|
2690
2715
|
progress_bar_type=progress_bar_type,
|
|
2691
2716
|
bqstorage_client=bqstorage_client,
|
|
2692
2717
|
create_bqstorage_client=create_bqstorage_client,
|
|
2718
|
+
timeout=timeout,
|
|
2693
2719
|
)
|
|
2694
2720
|
|
|
2695
2721
|
# Default date dtype is `db_dtypes.DateDtype()` that could cause out of bounds error,
|
|
@@ -2768,6 +2794,7 @@ class RowIterator(HTTPIterator):
|
|
|
2768
2794
|
int_dtype: Union[Any, None] = DefaultPandasDTypes.INT_DTYPE,
|
|
2769
2795
|
float_dtype: Union[Any, None] = None,
|
|
2770
2796
|
string_dtype: Union[Any, None] = None,
|
|
2797
|
+
timeout: Optional[float] = None,
|
|
2771
2798
|
) -> "geopandas.GeoDataFrame":
|
|
2772
2799
|
"""Create a GeoPandas GeoDataFrame by loading all pages of a query.
|
|
2773
2800
|
|
|
@@ -2902,6 +2929,7 @@ class RowIterator(HTTPIterator):
|
|
|
2902
2929
|
int_dtype=int_dtype,
|
|
2903
2930
|
float_dtype=float_dtype,
|
|
2904
2931
|
string_dtype=string_dtype,
|
|
2932
|
+
timeout=timeout,
|
|
2905
2933
|
)
|
|
2906
2934
|
|
|
2907
2935
|
return geopandas.GeoDataFrame(
|
|
@@ -2917,9 +2945,6 @@ class _EmptyRowIterator(RowIterator):
|
|
|
2917
2945
|
statements.
|
|
2918
2946
|
"""
|
|
2919
2947
|
|
|
2920
|
-
pages = ()
|
|
2921
|
-
total_rows = 0
|
|
2922
|
-
|
|
2923
2948
|
def __init__(
|
|
2924
2949
|
self, client=None, api_request=None, path=None, schema=(), *args, **kwargs
|
|
2925
2950
|
):
|
|
@@ -2931,12 +2956,14 @@ class _EmptyRowIterator(RowIterator):
|
|
|
2931
2956
|
*args,
|
|
2932
2957
|
**kwargs,
|
|
2933
2958
|
)
|
|
2959
|
+
self._total_rows = 0
|
|
2934
2960
|
|
|
2935
2961
|
def to_arrow(
|
|
2936
2962
|
self,
|
|
2937
2963
|
progress_bar_type=None,
|
|
2938
2964
|
bqstorage_client=None,
|
|
2939
2965
|
create_bqstorage_client=True,
|
|
2966
|
+
timeout: Optional[float] = None,
|
|
2940
2967
|
) -> "pyarrow.Table":
|
|
2941
2968
|
"""[Beta] Create an empty class:`pyarrow.Table`.
|
|
2942
2969
|
|
|
@@ -2944,6 +2971,7 @@ class _EmptyRowIterator(RowIterator):
|
|
|
2944
2971
|
progress_bar_type (str): Ignored. Added for compatibility with RowIterator.
|
|
2945
2972
|
bqstorage_client (Any): Ignored. Added for compatibility with RowIterator.
|
|
2946
2973
|
create_bqstorage_client (bool): Ignored. Added for compatibility with RowIterator.
|
|
2974
|
+
timeout (Optional[float]): Ignored. Added for compatibility with RowIterator.
|
|
2947
2975
|
|
|
2948
2976
|
Returns:
|
|
2949
2977
|
pyarrow.Table: An empty :class:`pyarrow.Table`.
|
|
@@ -2970,6 +2998,7 @@ class _EmptyRowIterator(RowIterator):
|
|
|
2970
2998
|
range_date_dtype=None,
|
|
2971
2999
|
range_datetime_dtype=None,
|
|
2972
3000
|
range_timestamp_dtype=None,
|
|
3001
|
+
timeout: Optional[float] = None,
|
|
2973
3002
|
) -> "pandas.DataFrame":
|
|
2974
3003
|
"""Create an empty dataframe.
|
|
2975
3004
|
|
|
@@ -2990,6 +3019,7 @@ class _EmptyRowIterator(RowIterator):
|
|
|
2990
3019
|
range_date_dtype (Any): Ignored. Added for compatibility with RowIterator.
|
|
2991
3020
|
range_datetime_dtype (Any): Ignored. Added for compatibility with RowIterator.
|
|
2992
3021
|
range_timestamp_dtype (Any): Ignored. Added for compatibility with RowIterator.
|
|
3022
|
+
timeout (Optional[float]): Ignored. Added for compatibility with RowIterator.
|
|
2993
3023
|
|
|
2994
3024
|
Returns:
|
|
2995
3025
|
pandas.DataFrame: An empty :class:`~pandas.DataFrame`.
|
|
@@ -3008,6 +3038,7 @@ class _EmptyRowIterator(RowIterator):
|
|
|
3008
3038
|
int_dtype: Union[Any, None] = DefaultPandasDTypes.INT_DTYPE,
|
|
3009
3039
|
float_dtype: Union[Any, None] = None,
|
|
3010
3040
|
string_dtype: Union[Any, None] = None,
|
|
3041
|
+
timeout: Optional[float] = None,
|
|
3011
3042
|
) -> "pandas.DataFrame":
|
|
3012
3043
|
"""Create an empty dataframe.
|
|
3013
3044
|
|
|
@@ -3021,6 +3052,7 @@ class _EmptyRowIterator(RowIterator):
|
|
|
3021
3052
|
int_dtype (Any): Ignored. Added for compatibility with RowIterator.
|
|
3022
3053
|
float_dtype (Any): Ignored. Added for compatibility with RowIterator.
|
|
3023
3054
|
string_dtype (Any): Ignored. Added for compatibility with RowIterator.
|
|
3055
|
+
timeout (Optional[float]): Ignored. Added for compatibility with RowIterator.
|
|
3024
3056
|
|
|
3025
3057
|
Returns:
|
|
3026
3058
|
pandas.DataFrame: An empty :class:`~pandas.DataFrame`.
|
|
@@ -3038,6 +3070,7 @@ class _EmptyRowIterator(RowIterator):
|
|
|
3038
3070
|
dtypes: Optional[Dict[str, Any]] = None,
|
|
3039
3071
|
max_queue_size: Optional[int] = None,
|
|
3040
3072
|
max_stream_count: Optional[int] = None,
|
|
3073
|
+
timeout: Optional[float] = None,
|
|
3041
3074
|
) -> Iterator["pandas.DataFrame"]:
|
|
3042
3075
|
"""Create an iterable of pandas DataFrames, to process the table as a stream.
|
|
3043
3076
|
|
|
@@ -3056,6 +3089,9 @@ class _EmptyRowIterator(RowIterator):
|
|
|
3056
3089
|
max_stream_count:
|
|
3057
3090
|
Ignored. Added for compatibility with RowIterator.
|
|
3058
3091
|
|
|
3092
|
+
timeout (Optional[float]):
|
|
3093
|
+
Ignored. Added for compatibility with RowIterator.
|
|
3094
|
+
|
|
3059
3095
|
Returns:
|
|
3060
3096
|
An iterator yielding a single empty :class:`~pandas.DataFrame`.
|
|
3061
3097
|
|
|
@@ -3071,6 +3107,7 @@ class _EmptyRowIterator(RowIterator):
|
|
|
3071
3107
|
bqstorage_client: Optional["bigquery_storage.BigQueryReadClient"] = None,
|
|
3072
3108
|
max_queue_size: Optional[int] = None,
|
|
3073
3109
|
max_stream_count: Optional[int] = None,
|
|
3110
|
+
timeout: Optional[float] = None,
|
|
3074
3111
|
) -> Iterator["pyarrow.RecordBatch"]:
|
|
3075
3112
|
"""Create an iterable of pandas DataFrames, to process the table as a stream.
|
|
3076
3113
|
|
|
@@ -3086,6 +3123,9 @@ class _EmptyRowIterator(RowIterator):
|
|
|
3086
3123
|
max_stream_count:
|
|
3087
3124
|
Ignored. Added for compatibility with RowIterator.
|
|
3088
3125
|
|
|
3126
|
+
timeout (Optional[float]):
|
|
3127
|
+
Ignored. Added for compatibility with RowIterator.
|
|
3128
|
+
|
|
3089
3129
|
Returns:
|
|
3090
3130
|
An iterator yielding a single empty :class:`~pyarrow.RecordBatch`.
|
|
3091
3131
|
"""
|