google-cloud-bigquery 3.33.0__tar.gz → 3.35.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.
- {google_cloud_bigquery-3.33.0/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.35.0}/PKG-INFO +3 -2
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_helpers.py +1 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_job_helpers.py +3 -10
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_pandas_helpers.py +3 -8
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/client.py +74 -11
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dataset.py +27 -10
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/enums.py +73 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/external_config.py +134 -4
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/job/base.py +1 -3
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/job/load.py +171 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/job/query.py +10 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/query.py +14 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/routine/routine.py +3 -9
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/schema.py +2 -4
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/table.py +24 -9
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/version.py +1 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0/google_cloud_bigquery.egg-info}/PKG-INFO +3 -2
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_load.py +88 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_load_config.py +244 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_query.py +74 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_query_pandas.py +5 -7
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test__job_helpers.py +6 -6
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test__pandas_helpers.py +1 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test__pyarrow_helpers.py +1 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_client.py +172 -2
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_create_dataset.py +6 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_dataset.py +67 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_dbapi__helpers.py +1 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_external_config.py +72 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_magics.py +10 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_query.py +16 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_table.py +26 -2
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_table_arrow.py +2 -1
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_table_pandas.py +6 -8
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/LICENSE +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/MANIFEST.in +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/README.rst +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_http.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_versions_helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dbapi/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dbapi/connection.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dbapi/cursor.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dbapi/types.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/encryption_configuration.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/exceptions.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/format_options.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/iam.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/job/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/job/copy_.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/job/extract.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/magics/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/magics/magics.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/model.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/py.typed +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/retry.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/routine/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/standard_sql.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery_v2/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery_v2/types/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery_v2/types/model.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google_cloud_bigquery.egg-info/SOURCES.txt +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google_cloud_bigquery.egg-info/requires.txt +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/pyproject.toml +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/setup.cfg +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/setup.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/characters.json +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/characters.jsonl +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/colors.avro +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/numeric_38_12.parquet +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/people.csv +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/scalars.csv +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/scalars.jsonl +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/scalars_extreme.jsonl +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/scalars_schema.json +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/scalars_schema_csv.json +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/data/schema.json +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/scrub_datasets.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/conftest.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_arrow.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_client.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_job_retry.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_list_rows.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_magics.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_pandas.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_query.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/system/test_structs.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/_helpers/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/_helpers/test_cell_data_parser.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/_helpers/test_data_frame_cell_data_parser.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/_helpers/test_scalar_query_param_parser.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/conftest.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_base.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_copy.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_extract.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_query_config.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/job/test_query_stats.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/line_arg_parser/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/line_arg_parser/test_lexer.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/line_arg_parser/test_parser.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/line_arg_parser/test_visitors.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/model/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/model/test_model.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/model/test_model_reference.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/routine/__init__.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/routine/test_remote_function_options.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/routine/test_routine.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/routine/test_routine_argument.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/routine/test_routine_reference.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test__helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test__http.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test__versions_helpers.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_dbapi_connection.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_dbapi_cursor.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_dbapi_types.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_delete_dataset.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_encryption_configuration.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_format_options.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_job_retry.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_legacy_types.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_list_datasets.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_list_jobs.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_list_models.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_list_projects.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_list_routines.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_list_tables.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_opentelemetry_tracing.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_packaging.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_retry.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_schema.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_signature_compatibility.py +0 -0
- {google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/tests/unit/test_standard_sql_types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-bigquery
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.35.0
|
|
4
4
|
Summary: Google BigQuery API client library
|
|
5
5
|
Author-email: Google LLC <googleapis-packages@google.com>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -62,6 +62,7 @@ Requires-Dist: proto-plus<2.0.0,>=1.22.3; extra == "bigquery-v2"
|
|
|
62
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"
|
|
63
63
|
Provides-Extra: all
|
|
64
64
|
Requires-Dist: google-cloud-bigquery[bigquery_v2,bqstorage,geopandas,ipython,ipywidgets,matplotlib,opentelemetry,pandas,tqdm]; extra == "all"
|
|
65
|
+
Dynamic: license-file
|
|
65
66
|
|
|
66
67
|
Python Client for Google BigQuery
|
|
67
68
|
=================================
|
{google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_helpers.py
RENAMED
|
@@ -388,7 +388,7 @@ CELL_DATA_PARSER = CellDataParser()
|
|
|
388
388
|
|
|
389
389
|
|
|
390
390
|
class DataFrameCellDataParser(CellDataParser):
|
|
391
|
-
"""Override of CellDataParser to handle differences in
|
|
391
|
+
"""Override of CellDataParser to handle differences in expression of values in DataFrame-like outputs.
|
|
392
392
|
|
|
393
393
|
This is used to turn the output of the REST API into a pyarrow Table,
|
|
394
394
|
emulating the serialized arrow from the BigQuery Storage Read API.
|
{google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/_job_helpers.py
RENAMED
|
@@ -37,7 +37,6 @@ predicates where it is safe to generate a new query ID.
|
|
|
37
37
|
|
|
38
38
|
import copy
|
|
39
39
|
import functools
|
|
40
|
-
import os
|
|
41
40
|
import uuid
|
|
42
41
|
import textwrap
|
|
43
42
|
from typing import Any, Dict, Optional, TYPE_CHECKING, Union
|
|
@@ -400,12 +399,6 @@ def query_and_wait(
|
|
|
400
399
|
) -> table.RowIterator:
|
|
401
400
|
"""Run the query, wait for it to finish, and return the results.
|
|
402
401
|
|
|
403
|
-
While ``jobCreationMode=JOB_CREATION_OPTIONAL`` is in preview in the
|
|
404
|
-
``jobs.query`` REST API, use the default ``jobCreationMode`` unless
|
|
405
|
-
the environment variable ``QUERY_PREVIEW_ENABLED=true``. After
|
|
406
|
-
``jobCreationMode`` is GA, this method will always use
|
|
407
|
-
``jobCreationMode=JOB_CREATION_OPTIONAL``. See:
|
|
408
|
-
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query
|
|
409
402
|
|
|
410
403
|
Args:
|
|
411
404
|
client:
|
|
@@ -500,9 +493,8 @@ def query_and_wait(
|
|
|
500
493
|
request_body["maxResults"] = min(page_size, max_results)
|
|
501
494
|
elif page_size is not None or max_results is not None:
|
|
502
495
|
request_body["maxResults"] = page_size or max_results
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
request_body["jobCreationMode"] = "JOB_CREATION_OPTIONAL"
|
|
496
|
+
if client.default_job_creation_mode:
|
|
497
|
+
request_body["jobCreationMode"] = client.default_job_creation_mode
|
|
506
498
|
|
|
507
499
|
def do_query():
|
|
508
500
|
request_body["requestId"] = make_job_id()
|
|
@@ -568,6 +560,7 @@ def query_and_wait(
|
|
|
568
560
|
num_dml_affected_rows=query_results.num_dml_affected_rows,
|
|
569
561
|
query=query,
|
|
570
562
|
total_bytes_processed=query_results.total_bytes_processed,
|
|
563
|
+
slot_millis=query_results.slot_millis,
|
|
571
564
|
)
|
|
572
565
|
|
|
573
566
|
if job_retry is not None:
|
|
@@ -337,13 +337,8 @@ def default_types_mapper(
|
|
|
337
337
|
):
|
|
338
338
|
return range_date_dtype
|
|
339
339
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
elif (
|
|
343
|
-
range_timestamp_dtype is not None
|
|
344
|
-
and arrow_data_type.equals( # pragma: NO COVER
|
|
345
|
-
range_timestamp_dtype.pyarrow_dtype
|
|
346
|
-
)
|
|
340
|
+
elif range_timestamp_dtype is not None and arrow_data_type.equals(
|
|
341
|
+
range_timestamp_dtype.pyarrow_dtype
|
|
347
342
|
):
|
|
348
343
|
return range_timestamp_dtype
|
|
349
344
|
|
|
@@ -1144,7 +1139,7 @@ def determine_requested_streams(
|
|
|
1144
1139
|
"""
|
|
1145
1140
|
|
|
1146
1141
|
if preserve_order:
|
|
1147
|
-
# If preserve order is set, it takes
|
|
1142
|
+
# If preserve order is set, it takes precedence.
|
|
1148
1143
|
# Limit the requested streams to 1, to ensure that order
|
|
1149
1144
|
# is preserved)
|
|
1150
1145
|
return 1
|
{google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/client.py
RENAMED
|
@@ -90,7 +90,8 @@ from google.cloud.bigquery._job_helpers import make_job_id as _make_job_id
|
|
|
90
90
|
from google.cloud.bigquery.dataset import Dataset
|
|
91
91
|
from google.cloud.bigquery.dataset import DatasetListItem
|
|
92
92
|
from google.cloud.bigquery.dataset import DatasetReference
|
|
93
|
-
|
|
93
|
+
|
|
94
|
+
from google.cloud.bigquery.enums import AutoRowIDs, DatasetView, UpdateMode
|
|
94
95
|
from google.cloud.bigquery.format_options import ParquetOptions
|
|
95
96
|
from google.cloud.bigquery.job import (
|
|
96
97
|
CopyJob,
|
|
@@ -221,6 +222,10 @@ class Client(ClientWithProject):
|
|
|
221
222
|
client_options (Optional[Union[google.api_core.client_options.ClientOptions, Dict]]):
|
|
222
223
|
Client options used to set user options on the client. API Endpoint
|
|
223
224
|
should be set through client_options.
|
|
225
|
+
default_job_creation_mode (Optional[str]):
|
|
226
|
+
Sets the default job creation mode used by query methods such as
|
|
227
|
+
query_and_wait(). For lightweight queries, JOB_CREATION_OPTIONAL is
|
|
228
|
+
generally recommended.
|
|
224
229
|
|
|
225
230
|
Raises:
|
|
226
231
|
google.auth.exceptions.DefaultCredentialsError:
|
|
@@ -243,6 +248,7 @@ class Client(ClientWithProject):
|
|
|
243
248
|
client_options: Optional[
|
|
244
249
|
Union[google.api_core.client_options.ClientOptions, Dict[str, Any]]
|
|
245
250
|
] = None,
|
|
251
|
+
default_job_creation_mode: Optional[str] = None,
|
|
246
252
|
) -> None:
|
|
247
253
|
if client_options is None:
|
|
248
254
|
client_options = {}
|
|
@@ -277,6 +283,7 @@ class Client(ClientWithProject):
|
|
|
277
283
|
self._connection = Connection(self, **kw_args)
|
|
278
284
|
self._location = location
|
|
279
285
|
self._default_load_job_config = copy.deepcopy(default_load_job_config)
|
|
286
|
+
self.default_job_creation_mode = default_job_creation_mode
|
|
280
287
|
|
|
281
288
|
# Use property setter so validation can run.
|
|
282
289
|
self.default_query_job_config = default_query_job_config
|
|
@@ -286,6 +293,15 @@ class Client(ClientWithProject):
|
|
|
286
293
|
"""Default location for jobs / datasets / tables."""
|
|
287
294
|
return self._location
|
|
288
295
|
|
|
296
|
+
@property
|
|
297
|
+
def default_job_creation_mode(self):
|
|
298
|
+
"""Default job creation mode used for query execution."""
|
|
299
|
+
return self._default_job_creation_mode
|
|
300
|
+
|
|
301
|
+
@default_job_creation_mode.setter
|
|
302
|
+
def default_job_creation_mode(self, value: Optional[str]):
|
|
303
|
+
self._default_job_creation_mode = value
|
|
304
|
+
|
|
289
305
|
@property
|
|
290
306
|
def default_query_job_config(self) -> Optional[QueryJobConfig]:
|
|
291
307
|
"""Default ``QueryJobConfig`` or ``None``.
|
|
@@ -849,6 +865,7 @@ class Client(ClientWithProject):
|
|
|
849
865
|
dataset_ref: Union[DatasetReference, str],
|
|
850
866
|
retry: retries.Retry = DEFAULT_RETRY,
|
|
851
867
|
timeout: TimeoutType = DEFAULT_TIMEOUT,
|
|
868
|
+
dataset_view: Optional[DatasetView] = None,
|
|
852
869
|
) -> Dataset:
|
|
853
870
|
"""Fetch the dataset referenced by ``dataset_ref``
|
|
854
871
|
|
|
@@ -866,7 +883,21 @@ class Client(ClientWithProject):
|
|
|
866
883
|
timeout (Optional[float]):
|
|
867
884
|
The number of seconds to wait for the underlying HTTP transport
|
|
868
885
|
before using ``retry``.
|
|
869
|
-
|
|
886
|
+
dataset_view (Optional[google.cloud.bigquery.enums.DatasetView]):
|
|
887
|
+
Specifies the view that determines which dataset information is
|
|
888
|
+
returned. By default, dataset metadata (e.g. friendlyName, description,
|
|
889
|
+
labels, etc) and ACL information are returned. This argument can
|
|
890
|
+
take on the following possible enum values.
|
|
891
|
+
|
|
892
|
+
* :attr:`~google.cloud.bigquery.enums.DatasetView.ACL`:
|
|
893
|
+
Includes dataset metadata and the ACL.
|
|
894
|
+
* :attr:`~google.cloud.bigquery.enums.DatasetView.FULL`:
|
|
895
|
+
Includes all dataset metadata, including the ACL and table metadata.
|
|
896
|
+
This view is not supported by the `datasets.list` API method.
|
|
897
|
+
* :attr:`~google.cloud.bigquery.enums.DatasetView.METADATA`:
|
|
898
|
+
Includes basic dataset metadata, but not the ACL.
|
|
899
|
+
* :attr:`~google.cloud.bigquery.enums.DatasetView.DATASET_VIEW_UNSPECIFIED`:
|
|
900
|
+
The server will decide which view to use. Currently defaults to FULL.
|
|
870
901
|
Returns:
|
|
871
902
|
google.cloud.bigquery.dataset.Dataset:
|
|
872
903
|
A ``Dataset`` instance.
|
|
@@ -876,6 +907,12 @@ class Client(ClientWithProject):
|
|
|
876
907
|
dataset_ref, default_project=self.project
|
|
877
908
|
)
|
|
878
909
|
path = dataset_ref.path
|
|
910
|
+
|
|
911
|
+
if dataset_view:
|
|
912
|
+
query_params = {"datasetView": dataset_view.value}
|
|
913
|
+
else:
|
|
914
|
+
query_params = {}
|
|
915
|
+
|
|
879
916
|
span_attributes = {"path": path}
|
|
880
917
|
api_response = self._call_api(
|
|
881
918
|
retry,
|
|
@@ -884,6 +921,7 @@ class Client(ClientWithProject):
|
|
|
884
921
|
method="GET",
|
|
885
922
|
path=path,
|
|
886
923
|
timeout=timeout,
|
|
924
|
+
query_params=query_params,
|
|
887
925
|
)
|
|
888
926
|
return Dataset.from_api_repr(api_response)
|
|
889
927
|
|
|
@@ -1183,6 +1221,7 @@ class Client(ClientWithProject):
|
|
|
1183
1221
|
fields: Sequence[str],
|
|
1184
1222
|
retry: retries.Retry = DEFAULT_RETRY,
|
|
1185
1223
|
timeout: TimeoutType = DEFAULT_TIMEOUT,
|
|
1224
|
+
update_mode: Optional[UpdateMode] = None,
|
|
1186
1225
|
) -> Dataset:
|
|
1187
1226
|
"""Change some fields of a dataset.
|
|
1188
1227
|
|
|
@@ -1222,6 +1261,20 @@ class Client(ClientWithProject):
|
|
|
1222
1261
|
timeout (Optional[float]):
|
|
1223
1262
|
The number of seconds to wait for the underlying HTTP transport
|
|
1224
1263
|
before using ``retry``.
|
|
1264
|
+
update_mode (Optional[google.cloud.bigquery.enums.UpdateMode]):
|
|
1265
|
+
Specifies the kind of information to update in a dataset.
|
|
1266
|
+
By default, dataset metadata (e.g. friendlyName, description,
|
|
1267
|
+
labels, etc) and ACL information are updated. This argument can
|
|
1268
|
+
take on the following possible enum values.
|
|
1269
|
+
|
|
1270
|
+
* :attr:`~google.cloud.bigquery.enums.UPDATE_MODE_UNSPECIFIED`:
|
|
1271
|
+
The default value. Behavior defaults to UPDATE_FULL.
|
|
1272
|
+
* :attr:`~google.cloud.bigquery.enums.UpdateMode.UPDATE_METADATA`:
|
|
1273
|
+
Includes metadata information for the dataset, such as friendlyName, description, labels, etc.
|
|
1274
|
+
* :attr:`~google.cloud.bigquery.enums.UpdateMode.UPDATE_ACL`:
|
|
1275
|
+
Includes ACL information for the dataset, which defines dataset access for one or more entities.
|
|
1276
|
+
* :attr:`~google.cloud.bigquery.enums.UpdateMode.UPDATE_FULL`:
|
|
1277
|
+
Includes both dataset metadata and ACL information.
|
|
1225
1278
|
|
|
1226
1279
|
Returns:
|
|
1227
1280
|
google.cloud.bigquery.dataset.Dataset:
|
|
@@ -1235,6 +1288,11 @@ class Client(ClientWithProject):
|
|
|
1235
1288
|
path = dataset.path
|
|
1236
1289
|
span_attributes = {"path": path, "fields": fields}
|
|
1237
1290
|
|
|
1291
|
+
if update_mode:
|
|
1292
|
+
query_params = {"updateMode": update_mode.value}
|
|
1293
|
+
else:
|
|
1294
|
+
query_params = {}
|
|
1295
|
+
|
|
1238
1296
|
api_response = self._call_api(
|
|
1239
1297
|
retry,
|
|
1240
1298
|
span_name="BigQuery.updateDataset",
|
|
@@ -1244,6 +1302,7 @@ class Client(ClientWithProject):
|
|
|
1244
1302
|
data=partial,
|
|
1245
1303
|
headers=headers,
|
|
1246
1304
|
timeout=timeout,
|
|
1305
|
+
query_params=query_params,
|
|
1247
1306
|
)
|
|
1248
1307
|
return Dataset.from_api_repr(api_response)
|
|
1249
1308
|
|
|
@@ -1986,6 +2045,7 @@ class Client(ClientWithProject):
|
|
|
1986
2045
|
location: Optional[str] = None,
|
|
1987
2046
|
timeout: TimeoutType = DEFAULT_TIMEOUT,
|
|
1988
2047
|
page_size: int = 0,
|
|
2048
|
+
start_index: Optional[int] = None,
|
|
1989
2049
|
) -> _QueryResults:
|
|
1990
2050
|
"""Get the query results object for a query job.
|
|
1991
2051
|
|
|
@@ -2004,9 +2064,12 @@ class Client(ClientWithProject):
|
|
|
2004
2064
|
before using ``retry``. If set, this connection timeout may be
|
|
2005
2065
|
increased to a minimum value. This prevents retries on what
|
|
2006
2066
|
would otherwise be a successful response.
|
|
2007
|
-
page_size (int):
|
|
2067
|
+
page_size (Optional[int]):
|
|
2008
2068
|
Maximum number of rows in a single response. See maxResults in
|
|
2009
2069
|
the jobs.getQueryResults REST API.
|
|
2070
|
+
start_index (Optional[int]):
|
|
2071
|
+
Zero-based index of the starting row. See startIndex in the
|
|
2072
|
+
jobs.getQueryResults REST API.
|
|
2010
2073
|
|
|
2011
2074
|
Returns:
|
|
2012
2075
|
google.cloud.bigquery.query._QueryResults:
|
|
@@ -2036,6 +2099,9 @@ class Client(ClientWithProject):
|
|
|
2036
2099
|
if location is not None:
|
|
2037
2100
|
extra_params["location"] = location
|
|
2038
2101
|
|
|
2102
|
+
if start_index is not None:
|
|
2103
|
+
extra_params["startIndex"] = start_index
|
|
2104
|
+
|
|
2039
2105
|
path = "/projects/{}/queries/{}".format(project, job_id)
|
|
2040
2106
|
|
|
2041
2107
|
# This call is typically made in a polling loop that checks whether the
|
|
@@ -3532,13 +3598,6 @@ class Client(ClientWithProject):
|
|
|
3532
3598
|
) -> RowIterator:
|
|
3533
3599
|
"""Run the query, wait for it to finish, and return the results.
|
|
3534
3600
|
|
|
3535
|
-
While ``jobCreationMode=JOB_CREATION_OPTIONAL`` is in preview in the
|
|
3536
|
-
``jobs.query`` REST API, use the default ``jobCreationMode`` unless
|
|
3537
|
-
the environment variable ``QUERY_PREVIEW_ENABLED=true``. After
|
|
3538
|
-
``jobCreationMode`` is GA, this method will always use
|
|
3539
|
-
``jobCreationMode=JOB_CREATION_OPTIONAL``. See:
|
|
3540
|
-
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query
|
|
3541
|
-
|
|
3542
3601
|
Args:
|
|
3543
3602
|
query (str):
|
|
3544
3603
|
SQL query to be executed. Defaults to the standard SQL
|
|
@@ -4085,6 +4144,7 @@ class Client(ClientWithProject):
|
|
|
4085
4144
|
num_dml_affected_rows: Optional[int] = None,
|
|
4086
4145
|
query: Optional[str] = None,
|
|
4087
4146
|
total_bytes_processed: Optional[int] = None,
|
|
4147
|
+
slot_millis: Optional[int] = None,
|
|
4088
4148
|
) -> RowIterator:
|
|
4089
4149
|
"""List the rows of a completed query.
|
|
4090
4150
|
See
|
|
@@ -4134,8 +4194,10 @@ class Client(ClientWithProject):
|
|
|
4134
4194
|
rows that were affected.
|
|
4135
4195
|
query (Optional[str]):
|
|
4136
4196
|
The query text used.
|
|
4137
|
-
total_bytes_processed (
|
|
4197
|
+
total_bytes_processed (Optional[int]):
|
|
4138
4198
|
total bytes processed from job statistics, if present.
|
|
4199
|
+
slot_millis (Optional[int]):
|
|
4200
|
+
Number of slot ms the user is actually billed for.
|
|
4139
4201
|
|
|
4140
4202
|
Returns:
|
|
4141
4203
|
google.cloud.bigquery.table.RowIterator:
|
|
@@ -4175,6 +4237,7 @@ class Client(ClientWithProject):
|
|
|
4175
4237
|
num_dml_affected_rows=num_dml_affected_rows,
|
|
4176
4238
|
query=query,
|
|
4177
4239
|
total_bytes_processed=total_bytes_processed,
|
|
4240
|
+
slot_millis=slot_millis,
|
|
4178
4241
|
)
|
|
4179
4242
|
return row_iterator
|
|
4180
4243
|
|
{google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/dataset.py
RENAMED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
from __future__ import absolute_import
|
|
18
18
|
|
|
19
19
|
import copy
|
|
20
|
+
import json
|
|
20
21
|
|
|
21
22
|
import typing
|
|
22
23
|
from typing import Optional, List, Dict, Any, Union
|
|
@@ -506,7 +507,20 @@ class AccessEntry(object):
|
|
|
506
507
|
def __eq__(self, other):
|
|
507
508
|
if not isinstance(other, AccessEntry):
|
|
508
509
|
return NotImplemented
|
|
509
|
-
return
|
|
510
|
+
return (
|
|
511
|
+
self.role == other.role
|
|
512
|
+
and self.entity_type == other.entity_type
|
|
513
|
+
and self._normalize_entity_id(self.entity_id)
|
|
514
|
+
== self._normalize_entity_id(other.entity_id)
|
|
515
|
+
and self.condition == other.condition
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
@staticmethod
|
|
519
|
+
def _normalize_entity_id(value):
|
|
520
|
+
"""Ensure consistent equality for dicts like 'view'."""
|
|
521
|
+
if isinstance(value, dict):
|
|
522
|
+
return json.dumps(value, sort_keys=True)
|
|
523
|
+
return value
|
|
510
524
|
|
|
511
525
|
def __ne__(self, other):
|
|
512
526
|
return not self == other
|
|
@@ -557,7 +571,6 @@ class AccessEntry(object):
|
|
|
557
571
|
google.cloud.bigquery.dataset.AccessEntry:
|
|
558
572
|
Access entry parsed from ``resource``.
|
|
559
573
|
"""
|
|
560
|
-
|
|
561
574
|
access_entry = cls()
|
|
562
575
|
access_entry._properties = resource.copy()
|
|
563
576
|
return access_entry
|
|
@@ -574,6 +587,10 @@ class Dataset(object):
|
|
|
574
587
|
A pointer to a dataset. If ``dataset_ref`` is a string, it must
|
|
575
588
|
include both the project ID and the dataset ID, separated by
|
|
576
589
|
``.``.
|
|
590
|
+
|
|
591
|
+
Note:
|
|
592
|
+
Fields marked as "Output Only" are populated by the server and will only be
|
|
593
|
+
available after calling :meth:`google.cloud.bigquery.client.Client.get_dataset`.
|
|
577
594
|
"""
|
|
578
595
|
|
|
579
596
|
_PROPERTY_TO_API_FIELD = {
|
|
@@ -692,7 +709,7 @@ class Dataset(object):
|
|
|
692
709
|
|
|
693
710
|
@property
|
|
694
711
|
def created(self):
|
|
695
|
-
"""Union[datetime.datetime, None]: Datetime at which the dataset was
|
|
712
|
+
"""Union[datetime.datetime, None]: Output only. Datetime at which the dataset was
|
|
696
713
|
created (:data:`None` until set from the server).
|
|
697
714
|
"""
|
|
698
715
|
creation_time = self._properties.get("creationTime")
|
|
@@ -709,8 +726,8 @@ class Dataset(object):
|
|
|
709
726
|
|
|
710
727
|
@property
|
|
711
728
|
def full_dataset_id(self):
|
|
712
|
-
"""Union[str, None]: ID for the dataset resource
|
|
713
|
-
set from the server)
|
|
729
|
+
"""Union[str, None]: Output only. ID for the dataset resource
|
|
730
|
+
(:data:`None` until set from the server).
|
|
714
731
|
|
|
715
732
|
In the format ``project_id:dataset_id``.
|
|
716
733
|
"""
|
|
@@ -725,14 +742,14 @@ class Dataset(object):
|
|
|
725
742
|
|
|
726
743
|
@property
|
|
727
744
|
def etag(self):
|
|
728
|
-
"""Union[str, None]: ETag for the dataset resource
|
|
729
|
-
set from the server).
|
|
745
|
+
"""Union[str, None]: Output only. ETag for the dataset resource
|
|
746
|
+
(:data:`None` until set from the server).
|
|
730
747
|
"""
|
|
731
748
|
return self._properties.get("etag")
|
|
732
749
|
|
|
733
750
|
@property
|
|
734
751
|
def modified(self):
|
|
735
|
-
"""Union[datetime.datetime, None]: Datetime at which the dataset was
|
|
752
|
+
"""Union[datetime.datetime, None]: Output only. Datetime at which the dataset was
|
|
736
753
|
last modified (:data:`None` until set from the server).
|
|
737
754
|
"""
|
|
738
755
|
modified_time = self._properties.get("lastModifiedTime")
|
|
@@ -744,8 +761,8 @@ class Dataset(object):
|
|
|
744
761
|
|
|
745
762
|
@property
|
|
746
763
|
def self_link(self):
|
|
747
|
-
"""Union[str, None]: URL for the dataset resource
|
|
748
|
-
set from the server).
|
|
764
|
+
"""Union[str, None]: Output only. URL for the dataset resource
|
|
765
|
+
(:data:`None` until set from the server).
|
|
749
766
|
"""
|
|
750
767
|
return self._properties.get("selfLink")
|
|
751
768
|
|
{google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/enums.py
RENAMED
|
@@ -80,6 +80,24 @@ class CreateDisposition(object):
|
|
|
80
80
|
returned in the job result."""
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
class DatasetView(enum.Enum):
|
|
84
|
+
"""DatasetView specifies which dataset information is returned."""
|
|
85
|
+
|
|
86
|
+
DATASET_VIEW_UNSPECIFIED = "DATASET_VIEW_UNSPECIFIED"
|
|
87
|
+
"""The default value. Currently maps to the FULL view."""
|
|
88
|
+
|
|
89
|
+
METADATA = "METADATA"
|
|
90
|
+
"""View metadata information for the dataset, such as friendlyName,
|
|
91
|
+
description, labels, etc."""
|
|
92
|
+
|
|
93
|
+
ACL = "ACL"
|
|
94
|
+
"""View ACL information for the dataset, which defines dataset access
|
|
95
|
+
for one or more entities."""
|
|
96
|
+
|
|
97
|
+
FULL = "FULL"
|
|
98
|
+
"""View both dataset metadata and ACL information."""
|
|
99
|
+
|
|
100
|
+
|
|
83
101
|
class DefaultPandasDTypes(enum.Enum):
|
|
84
102
|
"""Default Pandas DataFrem DTypes to convert BigQuery data. These
|
|
85
103
|
Sentinel values are used instead of None to maintain backward compatibility,
|
|
@@ -407,3 +425,58 @@ class BigLakeTableFormat(object):
|
|
|
407
425
|
|
|
408
426
|
ICEBERG = "ICEBERG"
|
|
409
427
|
"""Apache Iceberg format."""
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
class UpdateMode(enum.Enum):
|
|
431
|
+
"""Specifies the kind of information to update in a dataset."""
|
|
432
|
+
|
|
433
|
+
UPDATE_MODE_UNSPECIFIED = "UPDATE_MODE_UNSPECIFIED"
|
|
434
|
+
"""The default value. Behavior defaults to UPDATE_FULL."""
|
|
435
|
+
|
|
436
|
+
UPDATE_METADATA = "UPDATE_METADATA"
|
|
437
|
+
"""Includes metadata information for the dataset, such as friendlyName,
|
|
438
|
+
description, labels, etc."""
|
|
439
|
+
|
|
440
|
+
UPDATE_ACL = "UPDATE_ACL"
|
|
441
|
+
"""Includes ACL information for the dataset, which defines dataset access
|
|
442
|
+
for one or more entities."""
|
|
443
|
+
|
|
444
|
+
UPDATE_FULL = "UPDATE_FULL"
|
|
445
|
+
"""Includes both dataset metadata and ACL information."""
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
class JobCreationMode(object):
|
|
449
|
+
"""Documented values for Job Creation Mode."""
|
|
450
|
+
|
|
451
|
+
JOB_CREATION_MODE_UNSPECIFIED = "JOB_CREATION_MODE_UNSPECIFIED"
|
|
452
|
+
"""Job creation mode is unspecified."""
|
|
453
|
+
|
|
454
|
+
JOB_CREATION_REQUIRED = "JOB_CREATION_REQUIRED"
|
|
455
|
+
"""Job creation is always required."""
|
|
456
|
+
|
|
457
|
+
JOB_CREATION_OPTIONAL = "JOB_CREATION_OPTIONAL"
|
|
458
|
+
"""Job creation is optional.
|
|
459
|
+
|
|
460
|
+
Returning immediate results is prioritized.
|
|
461
|
+
BigQuery will automatically determine if a Job needs to be created.
|
|
462
|
+
The conditions under which BigQuery can decide to not create a Job are
|
|
463
|
+
subject to change.
|
|
464
|
+
"""
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
class SourceColumnMatch(str, enum.Enum):
|
|
468
|
+
"""Uses sensible defaults based on how the schema is provided.
|
|
469
|
+
If autodetect is used, then columns are matched by name. Otherwise, columns
|
|
470
|
+
are matched by position. This is done to keep the behavior backward-compatible.
|
|
471
|
+
"""
|
|
472
|
+
|
|
473
|
+
SOURCE_COLUMN_MATCH_UNSPECIFIED = "SOURCE_COLUMN_MATCH_UNSPECIFIED"
|
|
474
|
+
"""Unspecified column name match option."""
|
|
475
|
+
|
|
476
|
+
POSITION = "POSITION"
|
|
477
|
+
"""Matches by position. This assumes that the columns are ordered the same
|
|
478
|
+
way as the schema."""
|
|
479
|
+
|
|
480
|
+
NAME = "NAME"
|
|
481
|
+
"""Matches by name. This reads the header row as column names and reorders
|
|
482
|
+
columns to match the field names in the schema."""
|
|
@@ -22,6 +22,7 @@ from __future__ import absolute_import, annotations
|
|
|
22
22
|
|
|
23
23
|
import base64
|
|
24
24
|
import copy
|
|
25
|
+
import typing
|
|
25
26
|
from typing import Any, Dict, FrozenSet, Iterable, Optional, Union
|
|
26
27
|
|
|
27
28
|
from google.cloud.bigquery._helpers import _to_bytes
|
|
@@ -29,6 +30,7 @@ from google.cloud.bigquery._helpers import _bytes_to_json
|
|
|
29
30
|
from google.cloud.bigquery._helpers import _int_or_none
|
|
30
31
|
from google.cloud.bigquery._helpers import _str_or_none
|
|
31
32
|
from google.cloud.bigquery import _helpers
|
|
33
|
+
from google.cloud.bigquery.enums import SourceColumnMatch
|
|
32
34
|
from google.cloud.bigquery.format_options import AvroOptions, ParquetOptions
|
|
33
35
|
from google.cloud.bigquery import schema
|
|
34
36
|
from google.cloud.bigquery.schema import SchemaField
|
|
@@ -473,6 +475,60 @@ class CSVOptions(object):
|
|
|
473
475
|
def skip_leading_rows(self, value):
|
|
474
476
|
self._properties["skipLeadingRows"] = str(value)
|
|
475
477
|
|
|
478
|
+
@property
|
|
479
|
+
def source_column_match(self) -> Optional[SourceColumnMatch]:
|
|
480
|
+
"""Optional[google.cloud.bigquery.enums.SourceColumnMatch]: Controls the
|
|
481
|
+
strategy used to match loaded columns to the schema. If not set, a sensible
|
|
482
|
+
default is chosen based on how the schema is provided. If autodetect is
|
|
483
|
+
used, then columns are matched by name. Otherwise, columns are matched by
|
|
484
|
+
position. This is done to keep the behavior backward-compatible.
|
|
485
|
+
|
|
486
|
+
Acceptable values are:
|
|
487
|
+
|
|
488
|
+
SOURCE_COLUMN_MATCH_UNSPECIFIED: Unspecified column name match option.
|
|
489
|
+
POSITION: matches by position. This assumes that the columns are ordered
|
|
490
|
+
the same way as the schema.
|
|
491
|
+
NAME: matches by name. This reads the header row as column names and
|
|
492
|
+
reorders columns to match the field names in the schema.
|
|
493
|
+
|
|
494
|
+
See
|
|
495
|
+
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.source_column_match
|
|
496
|
+
"""
|
|
497
|
+
|
|
498
|
+
value = self._properties.get("sourceColumnMatch")
|
|
499
|
+
return SourceColumnMatch(value) if value is not None else None
|
|
500
|
+
|
|
501
|
+
@source_column_match.setter
|
|
502
|
+
def source_column_match(self, value: Union[SourceColumnMatch, str, None]):
|
|
503
|
+
if value is not None and not isinstance(value, (SourceColumnMatch, str)):
|
|
504
|
+
raise TypeError(
|
|
505
|
+
"value must be a google.cloud.bigquery.enums.SourceColumnMatch, str, or None"
|
|
506
|
+
)
|
|
507
|
+
if isinstance(value, SourceColumnMatch):
|
|
508
|
+
value = value.value
|
|
509
|
+
self._properties["sourceColumnMatch"] = value if value else None
|
|
510
|
+
|
|
511
|
+
@property
|
|
512
|
+
def null_markers(self) -> Optional[Iterable[str]]:
|
|
513
|
+
"""Optional[Iterable[str]]: A list of strings represented as SQL NULL values in a CSV file.
|
|
514
|
+
|
|
515
|
+
.. note::
|
|
516
|
+
null_marker and null_markers can't be set at the same time.
|
|
517
|
+
If null_marker is set, null_markers has to be not set.
|
|
518
|
+
If null_markers is set, null_marker has to be not set.
|
|
519
|
+
If both null_marker and null_markers are set at the same time, a user error would be thrown.
|
|
520
|
+
Any strings listed in null_markers, including empty string would be interpreted as SQL NULL.
|
|
521
|
+
This applies to all column types.
|
|
522
|
+
|
|
523
|
+
See
|
|
524
|
+
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.null_markers
|
|
525
|
+
"""
|
|
526
|
+
return self._properties.get("nullMarkers")
|
|
527
|
+
|
|
528
|
+
@null_markers.setter
|
|
529
|
+
def null_markers(self, value: Optional[Iterable[str]]):
|
|
530
|
+
self._properties["nullMarkers"] = value
|
|
531
|
+
|
|
476
532
|
def to_api_repr(self) -> dict:
|
|
477
533
|
"""Build an API representation of this object.
|
|
478
534
|
|
|
@@ -835,10 +891,10 @@ class ExternalConfig(object):
|
|
|
835
891
|
See
|
|
836
892
|
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ExternalDataConfiguration.FIELDS.schema
|
|
837
893
|
"""
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
return [SchemaField.from_api_repr(field) for field in prop.get("fields", [])]
|
|
894
|
+
prop: Dict[str, Any] = typing.cast(
|
|
895
|
+
Dict[str, Any], self._properties.get("schema", {})
|
|
896
|
+
)
|
|
897
|
+
return [SchemaField.from_api_repr(field) for field in prop.get("fields", [])]
|
|
842
898
|
|
|
843
899
|
@schema.setter
|
|
844
900
|
def schema(self, value):
|
|
@@ -847,6 +903,80 @@ class ExternalConfig(object):
|
|
|
847
903
|
prop = {"fields": [field.to_api_repr() for field in value]}
|
|
848
904
|
self._properties["schema"] = prop
|
|
849
905
|
|
|
906
|
+
@property
|
|
907
|
+
def date_format(self) -> Optional[str]:
|
|
908
|
+
"""Optional[str]: Format used to parse DATE values. Supports C-style and SQL-style values.
|
|
909
|
+
|
|
910
|
+
See:
|
|
911
|
+
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ExternalDataConfiguration.FIELDS.date_format
|
|
912
|
+
"""
|
|
913
|
+
result = self._properties.get("dateFormat")
|
|
914
|
+
return typing.cast(str, result)
|
|
915
|
+
|
|
916
|
+
@date_format.setter
|
|
917
|
+
def date_format(self, value: Optional[str]):
|
|
918
|
+
self._properties["dateFormat"] = value
|
|
919
|
+
|
|
920
|
+
@property
|
|
921
|
+
def datetime_format(self) -> Optional[str]:
|
|
922
|
+
"""Optional[str]: Format used to parse DATETIME values. Supports C-style
|
|
923
|
+
and SQL-style values.
|
|
924
|
+
|
|
925
|
+
See:
|
|
926
|
+
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ExternalDataConfiguration.FIELDS.datetime_format
|
|
927
|
+
"""
|
|
928
|
+
result = self._properties.get("datetimeFormat")
|
|
929
|
+
return typing.cast(str, result)
|
|
930
|
+
|
|
931
|
+
@datetime_format.setter
|
|
932
|
+
def datetime_format(self, value: Optional[str]):
|
|
933
|
+
self._properties["datetimeFormat"] = value
|
|
934
|
+
|
|
935
|
+
@property
|
|
936
|
+
def time_zone(self) -> Optional[str]:
|
|
937
|
+
"""Optional[str]: Time zone used when parsing timestamp values that do not
|
|
938
|
+
have specific time zone information (e.g. 2024-04-20 12:34:56). The expected
|
|
939
|
+
format is an IANA timezone string (e.g. America/Los_Angeles).
|
|
940
|
+
|
|
941
|
+
See:
|
|
942
|
+
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ExternalDataConfiguration.FIELDS.time_zone
|
|
943
|
+
"""
|
|
944
|
+
|
|
945
|
+
result = self._properties.get("timeZone")
|
|
946
|
+
return typing.cast(str, result)
|
|
947
|
+
|
|
948
|
+
@time_zone.setter
|
|
949
|
+
def time_zone(self, value: Optional[str]):
|
|
950
|
+
self._properties["timeZone"] = value
|
|
951
|
+
|
|
952
|
+
@property
|
|
953
|
+
def time_format(self) -> Optional[str]:
|
|
954
|
+
"""Optional[str]: Format used to parse TIME values. Supports C-style and SQL-style values.
|
|
955
|
+
|
|
956
|
+
See:
|
|
957
|
+
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ExternalDataConfiguration.FIELDS.time_format
|
|
958
|
+
"""
|
|
959
|
+
result = self._properties.get("timeFormat")
|
|
960
|
+
return typing.cast(str, result)
|
|
961
|
+
|
|
962
|
+
@time_format.setter
|
|
963
|
+
def time_format(self, value: Optional[str]):
|
|
964
|
+
self._properties["timeFormat"] = value
|
|
965
|
+
|
|
966
|
+
@property
|
|
967
|
+
def timestamp_format(self) -> Optional[str]:
|
|
968
|
+
"""Optional[str]: Format used to parse TIMESTAMP values. Supports C-style and SQL-style values.
|
|
969
|
+
|
|
970
|
+
See:
|
|
971
|
+
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ExternalDataConfiguration.FIELDS.timestamp_format
|
|
972
|
+
"""
|
|
973
|
+
result = self._properties.get("timestampFormat")
|
|
974
|
+
return typing.cast(str, result)
|
|
975
|
+
|
|
976
|
+
@timestamp_format.setter
|
|
977
|
+
def timestamp_format(self, value: Optional[str]):
|
|
978
|
+
self._properties["timestampFormat"] = value
|
|
979
|
+
|
|
850
980
|
@property
|
|
851
981
|
def connection_id(self):
|
|
852
982
|
"""Optional[str]: [Experimental] ID of a BigQuery Connection API
|
{google_cloud_bigquery-3.33.0 → google_cloud_bigquery-3.35.0}/google/cloud/bigquery/job/base.py
RENAMED
|
@@ -435,9 +435,7 @@ class _AsyncJob(google.api_core.future.polling.PollingFuture):
|
|
|
435
435
|
@property
|
|
436
436
|
def configuration(self) -> _JobConfig:
|
|
437
437
|
"""Job-type specific configurtion."""
|
|
438
|
-
|
|
439
|
-
# manage a pytype issue that came up in another PR. See Issue: #2132
|
|
440
|
-
configuration = self._CONFIG_CLASS() # pytype: disable=not-callable
|
|
438
|
+
configuration: _JobConfig = self._CONFIG_CLASS() # pytype: disable=not-callable
|
|
441
439
|
configuration._properties = self._properties.setdefault("configuration", {})
|
|
442
440
|
return configuration
|
|
443
441
|
|