google-cloud-bigquery 3.26.0__tar.gz → 3.28.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.26.0/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.28.0}/PKG-INFO +6 -25
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_helpers.py +31 -1
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_pandas_helpers.py +99 -19
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/client.py +81 -71
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dataset.py +48 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/external_config.py +75 -1
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/schema.py +291 -57
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/table.py +102 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/version.py +1 -1
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0/google_cloud_bigquery.egg-info}/PKG-INFO +6 -25
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google_cloud_bigquery.egg-info/SOURCES.txt +1 -1
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google_cloud_bigquery.egg-info/requires.txt +2 -23
- google_cloud_bigquery-3.28.0/pyproject.toml +104 -0
- google_cloud_bigquery-3.28.0/setup.py +18 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_client.py +88 -2
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_load_config.py +24 -5
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test__helpers.py +32 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test__pandas_helpers.py +31 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_client.py +6 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_create_dataset.py +5 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_dataset.py +106 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_external_config.py +89 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_schema.py +312 -12
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_table.py +151 -6
- google_cloud_bigquery-3.26.0/google_cloud_bigquery.egg-info/not-zip-safe +0 -1
- google_cloud_bigquery-3.26.0/setup.py +0 -142
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/LICENSE +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/MANIFEST.in +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/README.rst +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_http.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_job_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_versions_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dbapi/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dbapi/connection.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dbapi/cursor.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dbapi/types.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/encryption_configuration.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/enums.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/exceptions.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/format_options.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/iam.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/job/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/job/base.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/job/copy_.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/job/extract.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/job/load.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/job/query.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/magics/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/magics/magics.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/model.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/py.typed +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/query.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/retry.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/routine/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/routine/routine.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/standard_sql.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery_v2/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery_v2/types/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery_v2/types/model.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/setup.cfg +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/characters.json +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/characters.jsonl +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/colors.avro +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/numeric_38_12.parquet +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/people.csv +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/scalars.csv +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/scalars.jsonl +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/scalars_extreme.jsonl +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/scalars_schema.json +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/scalars_schema_csv.json +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/data/schema.json +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/scrub_datasets.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/conftest.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_arrow.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_job_retry.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_list_rows.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_magics.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_pandas.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_query.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/system/test_structs.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/_helpers/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/_helpers/test_from_json.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/conftest.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_base.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_copy.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_extract.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_load.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_query.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_query_config.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_query_pandas.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/job/test_query_stats.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/line_arg_parser/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/line_arg_parser/test_lexer.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/line_arg_parser/test_parser.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/line_arg_parser/test_visitors.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/model/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/model/test_model.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/model/test_model_reference.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/routine/__init__.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/routine/test_remote_function_options.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/routine/test_routine.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/routine/test_routine_argument.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/routine/test_routine_reference.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test__http.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test__job_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test__pyarrow_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test__versions_helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_dbapi__helpers.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_dbapi_connection.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_dbapi_cursor.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_dbapi_types.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_delete_dataset.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_encryption_configuration.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_format_options.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_job_retry.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_legacy_types.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_list_datasets.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_list_jobs.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_list_models.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_list_projects.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_list_routines.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_list_tables.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_magics.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_opentelemetry_tracing.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_packaging.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_query.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_retry.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_signature_compatibility.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_standard_sql_types.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_table_arrow.py +0 -0
- {google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/tests/unit/test_table_pandas.py +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: google-cloud-bigquery
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.28.0
|
|
4
4
|
Summary: Google BigQuery API client library
|
|
5
|
-
|
|
6
|
-
Author: Google LLC
|
|
7
|
-
Author-email: googleapis-packages@google.com
|
|
5
|
+
Author-email: Google LLC <googleapis-packages@google.com>
|
|
8
6
|
License: Apache 2.0
|
|
9
|
-
|
|
7
|
+
Project-URL: Repository, https://github.com/googleapis/python-bigquery
|
|
10
8
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
9
|
Classifier: Intended Audience :: Developers
|
|
12
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -21,6 +19,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
21
19
|
Classifier: Operating System :: OS Independent
|
|
22
20
|
Classifier: Topic :: Internet
|
|
23
21
|
Requires-Python: >=3.7
|
|
22
|
+
Description-Content-Type: text/x-rst
|
|
24
23
|
License-File: LICENSE
|
|
25
24
|
Requires-Dist: google-api-core[grpc]<3.0.0dev,>=2.11.1
|
|
26
25
|
Requires-Dist: google-auth<3.0.0dev,>=2.14.1
|
|
@@ -43,7 +42,7 @@ Provides-Extra: ipywidgets
|
|
|
43
42
|
Requires-Dist: ipywidgets>=7.7.0; extra == "ipywidgets"
|
|
44
43
|
Requires-Dist: ipykernel>=6.0.0; extra == "ipywidgets"
|
|
45
44
|
Provides-Extra: geopandas
|
|
46
|
-
Requires-Dist: geopandas<
|
|
45
|
+
Requires-Dist: geopandas<2.0dev,>=0.9.0; extra == "geopandas"
|
|
47
46
|
Requires-Dist: Shapely<3.0.0dev,>=1.8.4; extra == "geopandas"
|
|
48
47
|
Provides-Extra: ipython
|
|
49
48
|
Requires-Dist: bigquery-magics>=0.1.0; extra == "ipython"
|
|
@@ -57,25 +56,7 @@ Provides-Extra: bigquery-v2
|
|
|
57
56
|
Requires-Dist: proto-plus<2.0.0dev,>=1.22.3; extra == "bigquery-v2"
|
|
58
57
|
Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2; extra == "bigquery-v2"
|
|
59
58
|
Provides-Extra: all
|
|
60
|
-
Requires-Dist: google-cloud-bigquery
|
|
61
|
-
Requires-Dist: grpcio<2.0dev,>=1.47.0; extra == "all"
|
|
62
|
-
Requires-Dist: grpcio<2.0dev,>=1.49.1; python_version >= "3.11" and extra == "all"
|
|
63
|
-
Requires-Dist: pyarrow>=3.0.0; extra == "all"
|
|
64
|
-
Requires-Dist: pandas>=1.1.0; extra == "all"
|
|
65
|
-
Requires-Dist: pyarrow>=3.0.0; extra == "all"
|
|
66
|
-
Requires-Dist: db-dtypes<2.0.0dev,>=0.3.0; extra == "all"
|
|
67
|
-
Requires-Dist: importlib_metadata>=1.0.0; python_version < "3.8" and extra == "all"
|
|
68
|
-
Requires-Dist: ipywidgets>=7.7.0; extra == "all"
|
|
69
|
-
Requires-Dist: ipykernel>=6.0.0; extra == "all"
|
|
70
|
-
Requires-Dist: geopandas<1.0dev,>=0.9.0; extra == "all"
|
|
71
|
-
Requires-Dist: Shapely<3.0.0dev,>=1.8.4; extra == "all"
|
|
72
|
-
Requires-Dist: bigquery-magics>=0.1.0; extra == "all"
|
|
73
|
-
Requires-Dist: tqdm<5.0.0dev,>=4.7.4; extra == "all"
|
|
74
|
-
Requires-Dist: opentelemetry-api>=1.1.0; extra == "all"
|
|
75
|
-
Requires-Dist: opentelemetry-sdk>=1.1.0; extra == "all"
|
|
76
|
-
Requires-Dist: opentelemetry-instrumentation>=0.20b0; extra == "all"
|
|
77
|
-
Requires-Dist: proto-plus<2.0.0dev,>=1.22.3; extra == "all"
|
|
78
|
-
Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2; extra == "all"
|
|
59
|
+
Requires-Dist: google-cloud-bigquery[bigquery_v2,bqstorage,geopandas,ipython,ipywidgets,opentelemetry,pandas,tqdm]; extra == "all"
|
|
79
60
|
|
|
80
61
|
Python Client for Google BigQuery
|
|
81
62
|
=================================
|
{google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/_helpers.py
RENAMED
|
@@ -22,7 +22,7 @@ import math
|
|
|
22
22
|
import re
|
|
23
23
|
import os
|
|
24
24
|
import warnings
|
|
25
|
-
from typing import Optional, Union
|
|
25
|
+
from typing import Optional, Union, Any, Tuple, Type
|
|
26
26
|
|
|
27
27
|
from dateutil import relativedelta
|
|
28
28
|
from google.cloud._helpers import UTC # type: ignore
|
|
@@ -1004,3 +1004,33 @@ def _verify_job_config_type(job_config, expected_type, param_name="job_config"):
|
|
|
1004
1004
|
job_config=job_config,
|
|
1005
1005
|
)
|
|
1006
1006
|
)
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
def _isinstance_or_raise(
|
|
1010
|
+
value: Any,
|
|
1011
|
+
dtype: Union[Type, Tuple[Type, ...]],
|
|
1012
|
+
none_allowed: Optional[bool] = False,
|
|
1013
|
+
) -> Any:
|
|
1014
|
+
"""Determine whether a value type matches a given datatype or None.
|
|
1015
|
+
Args:
|
|
1016
|
+
value (Any): Value to be checked.
|
|
1017
|
+
dtype (type): Expected data type or tuple of data types.
|
|
1018
|
+
none_allowed Optional(bool): whether value is allowed to be None. Default
|
|
1019
|
+
is False.
|
|
1020
|
+
Returns:
|
|
1021
|
+
Any: Returns the input value if the type check is successful.
|
|
1022
|
+
Raises:
|
|
1023
|
+
TypeError: If the input value's type does not match the expected data type(s).
|
|
1024
|
+
"""
|
|
1025
|
+
if none_allowed and value is None:
|
|
1026
|
+
return value
|
|
1027
|
+
|
|
1028
|
+
if isinstance(value, dtype):
|
|
1029
|
+
return value
|
|
1030
|
+
|
|
1031
|
+
or_none = ""
|
|
1032
|
+
if none_allowed:
|
|
1033
|
+
or_none = " (or None)"
|
|
1034
|
+
|
|
1035
|
+
msg = f"Pass {value} as a '{dtype}'{or_none}. Got {type(value)}."
|
|
1036
|
+
raise TypeError(msg)
|
|
@@ -21,13 +21,14 @@ from itertools import islice
|
|
|
21
21
|
import logging
|
|
22
22
|
import queue
|
|
23
23
|
import warnings
|
|
24
|
-
from typing import Any, Union
|
|
24
|
+
from typing import Any, Union, Optional, Callable, Generator, List
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
from google.cloud.bigquery import _pyarrow_helpers
|
|
28
28
|
from google.cloud.bigquery import _versions_helpers
|
|
29
29
|
from google.cloud.bigquery import schema
|
|
30
30
|
|
|
31
|
+
|
|
31
32
|
try:
|
|
32
33
|
import pandas # type: ignore
|
|
33
34
|
|
|
@@ -75,7 +76,7 @@ else:
|
|
|
75
76
|
_to_wkb = _to_wkb()
|
|
76
77
|
|
|
77
78
|
try:
|
|
78
|
-
from google.cloud.
|
|
79
|
+
from google.cloud.bigquery_storage_v1.types import ArrowSerializationOptions
|
|
79
80
|
except ImportError:
|
|
80
81
|
_ARROW_COMPRESSION_SUPPORT = False
|
|
81
82
|
else:
|
|
@@ -816,18 +817,54 @@ def _nowait(futures):
|
|
|
816
817
|
|
|
817
818
|
|
|
818
819
|
def _download_table_bqstorage(
|
|
819
|
-
project_id,
|
|
820
|
-
table,
|
|
821
|
-
bqstorage_client,
|
|
822
|
-
preserve_order=False,
|
|
823
|
-
selected_fields=None,
|
|
824
|
-
page_to_item=None,
|
|
825
|
-
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
826
|
-
|
|
827
|
-
|
|
820
|
+
project_id: str,
|
|
821
|
+
table: Any,
|
|
822
|
+
bqstorage_client: Any,
|
|
823
|
+
preserve_order: bool = False,
|
|
824
|
+
selected_fields: Optional[List[Any]] = None,
|
|
825
|
+
page_to_item: Optional[Callable] = None,
|
|
826
|
+
max_queue_size: Any = _MAX_QUEUE_SIZE_DEFAULT,
|
|
827
|
+
max_stream_count: Optional[int] = None,
|
|
828
|
+
) -> Generator[Any, None, None]:
|
|
829
|
+
"""Downloads a BigQuery table using the BigQuery Storage API.
|
|
830
|
+
|
|
831
|
+
This method uses the faster, but potentially more expensive, BigQuery
|
|
832
|
+
Storage API to download a table as a Pandas DataFrame. It supports
|
|
833
|
+
parallel downloads and optional data transformations.
|
|
834
|
+
|
|
835
|
+
Args:
|
|
836
|
+
project_id (str): The ID of the Google Cloud project containing
|
|
837
|
+
the table.
|
|
838
|
+
table (Any): The BigQuery table to download.
|
|
839
|
+
bqstorage_client (Any): An
|
|
840
|
+
authenticated BigQuery Storage API client.
|
|
841
|
+
preserve_order (bool, optional): Whether to preserve the order
|
|
842
|
+
of the rows as they are read from BigQuery. If True this limits
|
|
843
|
+
the number of streams to one and overrides `max_stream_count`.
|
|
844
|
+
Defaults to False.
|
|
845
|
+
selected_fields (Optional[List[SchemaField]]):
|
|
846
|
+
A list of BigQuery schema fields to select for download. If None,
|
|
847
|
+
all fields are downloaded. Defaults to None.
|
|
848
|
+
page_to_item (Optional[Callable]): An optional callable
|
|
849
|
+
function that takes a page of data from the BigQuery Storage API
|
|
850
|
+
max_stream_count (Optional[int]): The maximum number of
|
|
851
|
+
concurrent streams to use for downloading data. If `preserve_order`
|
|
852
|
+
is True, the requested streams are limited to 1 regardless of the
|
|
853
|
+
`max_stream_count` value. If 0 or None, then the number of
|
|
854
|
+
requested streams will be unbounded. Defaults to None.
|
|
855
|
+
|
|
856
|
+
Yields:
|
|
857
|
+
pandas.DataFrame: Pandas DataFrames, one for each chunk of data
|
|
858
|
+
downloaded from BigQuery.
|
|
859
|
+
|
|
860
|
+
Raises:
|
|
861
|
+
ValueError: If attempting to read from a specific partition or snapshot.
|
|
862
|
+
|
|
863
|
+
Note:
|
|
864
|
+
This method requires the `google-cloud-bigquery-storage` library
|
|
865
|
+
to be installed.
|
|
866
|
+
"""
|
|
828
867
|
|
|
829
|
-
# Passing a BQ Storage client in implies that the BigQuery Storage library
|
|
830
|
-
# is available and can be imported.
|
|
831
868
|
from google.cloud import bigquery_storage
|
|
832
869
|
|
|
833
870
|
if "$" in table.table_id:
|
|
@@ -837,10 +874,11 @@ def _download_table_bqstorage(
|
|
|
837
874
|
if "@" in table.table_id:
|
|
838
875
|
raise ValueError("Reading from a specific snapshot is not currently supported.")
|
|
839
876
|
|
|
840
|
-
requested_streams =
|
|
877
|
+
requested_streams = determine_requested_streams(preserve_order, max_stream_count)
|
|
841
878
|
|
|
842
|
-
requested_session = bigquery_storage.types.ReadSession(
|
|
843
|
-
table=table.to_bqstorage(),
|
|
879
|
+
requested_session = bigquery_storage.types.stream.ReadSession(
|
|
880
|
+
table=table.to_bqstorage(),
|
|
881
|
+
data_format=bigquery_storage.types.stream.DataFormat.ARROW,
|
|
844
882
|
)
|
|
845
883
|
if selected_fields is not None:
|
|
846
884
|
for field in selected_fields:
|
|
@@ -848,7 +886,8 @@ def _download_table_bqstorage(
|
|
|
848
886
|
|
|
849
887
|
if _ARROW_COMPRESSION_SUPPORT:
|
|
850
888
|
requested_session.read_options.arrow_serialization_options.buffer_compression = (
|
|
851
|
-
|
|
889
|
+
# CompressionCodec(1) -> LZ4_FRAME
|
|
890
|
+
ArrowSerializationOptions.CompressionCodec(1)
|
|
852
891
|
)
|
|
853
892
|
|
|
854
893
|
session = bqstorage_client.create_read_session(
|
|
@@ -884,7 +923,7 @@ def _download_table_bqstorage(
|
|
|
884
923
|
elif max_queue_size is None:
|
|
885
924
|
max_queue_size = 0 # unbounded
|
|
886
925
|
|
|
887
|
-
worker_queue = queue.Queue(maxsize=max_queue_size)
|
|
926
|
+
worker_queue: queue.Queue[int] = queue.Queue(maxsize=max_queue_size)
|
|
888
927
|
|
|
889
928
|
with concurrent.futures.ThreadPoolExecutor(max_workers=total_streams) as pool:
|
|
890
929
|
try:
|
|
@@ -910,7 +949,7 @@ def _download_table_bqstorage(
|
|
|
910
949
|
# we want to block on the queue's get method, instead. This
|
|
911
950
|
# prevents the queue from filling up, because the main thread
|
|
912
951
|
# has smaller gaps in time between calls to the queue's get
|
|
913
|
-
# method. For a detailed
|
|
952
|
+
# method. For a detailed explanation, see:
|
|
914
953
|
# https://friendliness.dev/2019/06/18/python-nowait/
|
|
915
954
|
done, not_done = _nowait(not_done)
|
|
916
955
|
for future in done:
|
|
@@ -949,6 +988,7 @@ def download_arrow_bqstorage(
|
|
|
949
988
|
preserve_order=False,
|
|
950
989
|
selected_fields=None,
|
|
951
990
|
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
991
|
+
max_stream_count=None,
|
|
952
992
|
):
|
|
953
993
|
return _download_table_bqstorage(
|
|
954
994
|
project_id,
|
|
@@ -958,6 +998,7 @@ def download_arrow_bqstorage(
|
|
|
958
998
|
selected_fields=selected_fields,
|
|
959
999
|
page_to_item=_bqstorage_page_to_arrow,
|
|
960
1000
|
max_queue_size=max_queue_size,
|
|
1001
|
+
max_stream_count=max_stream_count,
|
|
961
1002
|
)
|
|
962
1003
|
|
|
963
1004
|
|
|
@@ -970,6 +1011,7 @@ def download_dataframe_bqstorage(
|
|
|
970
1011
|
preserve_order=False,
|
|
971
1012
|
selected_fields=None,
|
|
972
1013
|
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
1014
|
+
max_stream_count=None,
|
|
973
1015
|
):
|
|
974
1016
|
page_to_item = functools.partial(_bqstorage_page_to_dataframe, column_names, dtypes)
|
|
975
1017
|
return _download_table_bqstorage(
|
|
@@ -980,6 +1022,7 @@ def download_dataframe_bqstorage(
|
|
|
980
1022
|
selected_fields=selected_fields,
|
|
981
1023
|
page_to_item=page_to_item,
|
|
982
1024
|
max_queue_size=max_queue_size,
|
|
1025
|
+
max_stream_count=max_stream_count,
|
|
983
1026
|
)
|
|
984
1027
|
|
|
985
1028
|
|
|
@@ -1024,3 +1067,40 @@ def verify_pandas_imports():
|
|
|
1024
1067
|
raise ValueError(_NO_PANDAS_ERROR) from pandas_import_exception
|
|
1025
1068
|
if db_dtypes is None:
|
|
1026
1069
|
raise ValueError(_NO_DB_TYPES_ERROR) from db_dtypes_import_exception
|
|
1070
|
+
|
|
1071
|
+
|
|
1072
|
+
def determine_requested_streams(
|
|
1073
|
+
preserve_order: bool,
|
|
1074
|
+
max_stream_count: Union[int, None],
|
|
1075
|
+
) -> int:
|
|
1076
|
+
"""Determines the value of requested_streams based on the values of
|
|
1077
|
+
`preserve_order` and `max_stream_count`.
|
|
1078
|
+
|
|
1079
|
+
Args:
|
|
1080
|
+
preserve_order (bool): Whether to preserve the order of streams. If True,
|
|
1081
|
+
this limits the number of streams to one. `preserve_order` takes
|
|
1082
|
+
precedence over `max_stream_count`.
|
|
1083
|
+
max_stream_count (Union[int, None]]): The maximum number of streams
|
|
1084
|
+
allowed. Must be a non-negative number or None, where None indicates
|
|
1085
|
+
the value is unset. NOTE: if `preserve_order` is also set, it takes
|
|
1086
|
+
precedence over `max_stream_count`, thus to ensure that `max_stream_count`
|
|
1087
|
+
is used, ensure that `preserve_order` is None.
|
|
1088
|
+
|
|
1089
|
+
Returns:
|
|
1090
|
+
(int) The appropriate value for requested_streams.
|
|
1091
|
+
"""
|
|
1092
|
+
|
|
1093
|
+
if preserve_order:
|
|
1094
|
+
# If preserve order is set, it takes precendence.
|
|
1095
|
+
# Limit the requested streams to 1, to ensure that order
|
|
1096
|
+
# is preserved)
|
|
1097
|
+
return 1
|
|
1098
|
+
|
|
1099
|
+
elif max_stream_count is not None:
|
|
1100
|
+
# If preserve_order is not set, only then do we consider max_stream_count
|
|
1101
|
+
if max_stream_count <= -1:
|
|
1102
|
+
raise ValueError("max_stream_count must be non-negative OR None")
|
|
1103
|
+
return max_stream_count
|
|
1104
|
+
|
|
1105
|
+
# Default to zero requested streams (unbounded).
|
|
1106
|
+
return 0
|
{google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/client.py
RENAMED
|
@@ -44,6 +44,8 @@ from typing import (
|
|
|
44
44
|
import uuid
|
|
45
45
|
import warnings
|
|
46
46
|
|
|
47
|
+
import requests
|
|
48
|
+
|
|
47
49
|
from google import resumable_media # type: ignore
|
|
48
50
|
from google.resumable_media.requests import MultipartUpload # type: ignore
|
|
49
51
|
from google.resumable_media.requests import ResumableUpload
|
|
@@ -65,6 +67,7 @@ except ImportError:
|
|
|
65
67
|
DEFAULT_BQSTORAGE_CLIENT_INFO = None # type: ignore
|
|
66
68
|
|
|
67
69
|
|
|
70
|
+
from google.auth.credentials import Credentials
|
|
68
71
|
from google.cloud.bigquery._http import Connection
|
|
69
72
|
from google.cloud.bigquery import _job_helpers
|
|
70
73
|
from google.cloud.bigquery import _pandas_helpers
|
|
@@ -126,6 +129,7 @@ pandas = (
|
|
|
126
129
|
_versions_helpers.PANDAS_VERSIONS.try_import()
|
|
127
130
|
) # mypy check fails because pandas import is outside module, there are type: ignore comments related to this
|
|
128
131
|
|
|
132
|
+
|
|
129
133
|
ResumableTimeoutType = Union[
|
|
130
134
|
None, float, Tuple[float, float]
|
|
131
135
|
] # for resumable media methods
|
|
@@ -133,8 +137,6 @@ ResumableTimeoutType = Union[
|
|
|
133
137
|
if typing.TYPE_CHECKING: # pragma: NO COVER
|
|
134
138
|
# os.PathLike is only subscriptable in Python 3.9+, thus shielding with a condition.
|
|
135
139
|
PathType = Union[str, bytes, os.PathLike[str], os.PathLike[bytes]]
|
|
136
|
-
import requests # required by api-core
|
|
137
|
-
|
|
138
140
|
_DEFAULT_CHUNKSIZE = 100 * 1024 * 1024 # 100 MB
|
|
139
141
|
_MAX_MULTIPART_SIZE = 5 * 1024 * 1024
|
|
140
142
|
_DEFAULT_NUM_RETRIES = 6
|
|
@@ -231,15 +233,23 @@ class Client(ClientWithProject):
|
|
|
231
233
|
|
|
232
234
|
def __init__(
|
|
233
235
|
self,
|
|
234
|
-
project=None,
|
|
235
|
-
credentials=None,
|
|
236
|
-
_http=None,
|
|
237
|
-
location=None,
|
|
238
|
-
default_query_job_config=None,
|
|
239
|
-
default_load_job_config=None,
|
|
240
|
-
client_info=None,
|
|
241
|
-
client_options
|
|
236
|
+
project: Optional[str] = None,
|
|
237
|
+
credentials: Optional[Credentials] = None,
|
|
238
|
+
_http: Optional[requests.Session] = None,
|
|
239
|
+
location: Optional[str] = None,
|
|
240
|
+
default_query_job_config: Optional[QueryJobConfig] = None,
|
|
241
|
+
default_load_job_config: Optional[LoadJobConfig] = None,
|
|
242
|
+
client_info: Optional[google.api_core.client_info.ClientInfo] = None,
|
|
243
|
+
client_options: Optional[
|
|
244
|
+
Union[google.api_core.client_options.ClientOptions, Dict[str, Any]]
|
|
245
|
+
] = None,
|
|
242
246
|
) -> None:
|
|
247
|
+
if client_options is None:
|
|
248
|
+
client_options = {}
|
|
249
|
+
if isinstance(client_options, dict):
|
|
250
|
+
client_options = google.api_core.client_options.from_dict(client_options)
|
|
251
|
+
# assert isinstance(client_options, google.api_core.client_options.ClientOptions)
|
|
252
|
+
|
|
243
253
|
super(Client, self).__init__(
|
|
244
254
|
project=project,
|
|
245
255
|
credentials=credentials,
|
|
@@ -247,14 +257,10 @@ class Client(ClientWithProject):
|
|
|
247
257
|
_http=_http,
|
|
248
258
|
)
|
|
249
259
|
|
|
250
|
-
kw_args = {"client_info": client_info}
|
|
260
|
+
kw_args: Dict[str, Any] = {"client_info": client_info}
|
|
251
261
|
bq_host = _get_bigquery_host()
|
|
252
262
|
kw_args["api_endpoint"] = bq_host if bq_host != _DEFAULT_HOST else None
|
|
253
263
|
client_universe = None
|
|
254
|
-
if client_options is None:
|
|
255
|
-
client_options = {}
|
|
256
|
-
if isinstance(client_options, dict):
|
|
257
|
-
client_options = google.api_core.client_options.from_dict(client_options)
|
|
258
264
|
if client_options.api_endpoint:
|
|
259
265
|
api_endpoint = client_options.api_endpoint
|
|
260
266
|
kw_args["api_endpoint"] = api_endpoint
|
|
@@ -328,6 +334,15 @@ class Client(ClientWithProject):
|
|
|
328
334
|
) -> str:
|
|
329
335
|
"""Get the email address of the project's BigQuery service account
|
|
330
336
|
|
|
337
|
+
Example:
|
|
338
|
+
|
|
339
|
+
.. code-block:: python
|
|
340
|
+
|
|
341
|
+
from google.cloud import bigquery
|
|
342
|
+
client = bigquery.Client()
|
|
343
|
+
client.get_service_account_email()
|
|
344
|
+
# returns an email similar to: my_service_account@my-project.iam.gserviceaccount.com
|
|
345
|
+
|
|
331
346
|
Note:
|
|
332
347
|
This is the service account that BigQuery uses to manage tables
|
|
333
348
|
encrypted by a key in KMS.
|
|
@@ -345,13 +360,6 @@ class Client(ClientWithProject):
|
|
|
345
360
|
str:
|
|
346
361
|
service account email address
|
|
347
362
|
|
|
348
|
-
Example:
|
|
349
|
-
|
|
350
|
-
>>> from google.cloud import bigquery
|
|
351
|
-
>>> client = bigquery.Client()
|
|
352
|
-
>>> client.get_service_account_email()
|
|
353
|
-
my_service_account@my-project.iam.gserviceaccount.com
|
|
354
|
-
|
|
355
363
|
"""
|
|
356
364
|
if project is None:
|
|
357
365
|
project = self.project
|
|
@@ -629,9 +637,19 @@ class Client(ClientWithProject):
|
|
|
629
637
|
) -> Dataset:
|
|
630
638
|
"""API call: create the dataset via a POST request.
|
|
631
639
|
|
|
640
|
+
|
|
632
641
|
See
|
|
633
642
|
https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/insert
|
|
634
643
|
|
|
644
|
+
Example:
|
|
645
|
+
|
|
646
|
+
.. code-block:: python
|
|
647
|
+
|
|
648
|
+
from google.cloud import bigquery
|
|
649
|
+
client = bigquery.Client()
|
|
650
|
+
dataset = bigquery.Dataset('my_project.my_dataset')
|
|
651
|
+
dataset = client.create_dataset(dataset)
|
|
652
|
+
|
|
635
653
|
Args:
|
|
636
654
|
dataset (Union[ \
|
|
637
655
|
google.cloud.bigquery.dataset.Dataset, \
|
|
@@ -658,14 +676,6 @@ class Client(ClientWithProject):
|
|
|
658
676
|
Raises:
|
|
659
677
|
google.cloud.exceptions.Conflict:
|
|
660
678
|
If the dataset already exists.
|
|
661
|
-
|
|
662
|
-
Example:
|
|
663
|
-
|
|
664
|
-
>>> from google.cloud import bigquery
|
|
665
|
-
>>> client = bigquery.Client()
|
|
666
|
-
>>> dataset = bigquery.Dataset('my_project.my_dataset')
|
|
667
|
-
>>> dataset = client.create_dataset(dataset)
|
|
668
|
-
|
|
669
679
|
"""
|
|
670
680
|
dataset = self._dataset_from_arg(dataset)
|
|
671
681
|
if isinstance(dataset, DatasetReference):
|
|
@@ -1180,6 +1190,19 @@ class Client(ClientWithProject):
|
|
|
1180
1190
|
must be provided. If a field is listed in ``fields`` and is ``None`` in
|
|
1181
1191
|
``dataset``, it will be deleted.
|
|
1182
1192
|
|
|
1193
|
+
For example, to update the default expiration times, specify
|
|
1194
|
+
both properties in the ``fields`` argument:
|
|
1195
|
+
|
|
1196
|
+
.. code-block:: python
|
|
1197
|
+
|
|
1198
|
+
bigquery_client.update_dataset(
|
|
1199
|
+
dataset,
|
|
1200
|
+
[
|
|
1201
|
+
"default_partition_expiration_ms",
|
|
1202
|
+
"default_table_expiration_ms",
|
|
1203
|
+
]
|
|
1204
|
+
)
|
|
1205
|
+
|
|
1183
1206
|
If ``dataset.etag`` is not ``None``, the update will only
|
|
1184
1207
|
succeed if the dataset on the server has the same ETag. Thus
|
|
1185
1208
|
reading a dataset with ``get_dataset``, changing its fields,
|
|
@@ -1194,19 +1217,6 @@ class Client(ClientWithProject):
|
|
|
1194
1217
|
The properties of ``dataset`` to change. These are strings
|
|
1195
1218
|
corresponding to the properties of
|
|
1196
1219
|
:class:`~google.cloud.bigquery.dataset.Dataset`.
|
|
1197
|
-
|
|
1198
|
-
For example, to update the default expiration times, specify
|
|
1199
|
-
both properties in the ``fields`` argument:
|
|
1200
|
-
|
|
1201
|
-
.. code-block:: python
|
|
1202
|
-
|
|
1203
|
-
bigquery_client.update_dataset(
|
|
1204
|
-
dataset,
|
|
1205
|
-
[
|
|
1206
|
-
"default_partition_expiration_ms",
|
|
1207
|
-
"default_table_expiration_ms",
|
|
1208
|
-
]
|
|
1209
|
-
)
|
|
1210
1220
|
retry (Optional[google.api_core.retry.Retry]):
|
|
1211
1221
|
How to retry the RPC.
|
|
1212
1222
|
timeout (Optional[float]):
|
|
@@ -1250,6 +1260,15 @@ class Client(ClientWithProject):
|
|
|
1250
1260
|
must be provided. If a field is listed in ``fields`` and is ``None``
|
|
1251
1261
|
in ``model``, the field value will be deleted.
|
|
1252
1262
|
|
|
1263
|
+
For example, to update the descriptive properties of the model,
|
|
1264
|
+
specify them in the ``fields`` argument:
|
|
1265
|
+
|
|
1266
|
+
.. code-block:: python
|
|
1267
|
+
|
|
1268
|
+
bigquery_client.update_model(
|
|
1269
|
+
model, ["description", "friendly_name"]
|
|
1270
|
+
)
|
|
1271
|
+
|
|
1253
1272
|
If ``model.etag`` is not ``None``, the update will only succeed if
|
|
1254
1273
|
the model on the server has the same ETag. Thus reading a model with
|
|
1255
1274
|
``get_model``, changing its fields, and then passing it to
|
|
@@ -1262,15 +1281,6 @@ class Client(ClientWithProject):
|
|
|
1262
1281
|
The properties of ``model`` to change. These are strings
|
|
1263
1282
|
corresponding to the properties of
|
|
1264
1283
|
:class:`~google.cloud.bigquery.model.Model`.
|
|
1265
|
-
|
|
1266
|
-
For example, to update the descriptive properties of the model,
|
|
1267
|
-
specify them in the ``fields`` argument:
|
|
1268
|
-
|
|
1269
|
-
.. code-block:: python
|
|
1270
|
-
|
|
1271
|
-
bigquery_client.update_model(
|
|
1272
|
-
model, ["description", "friendly_name"]
|
|
1273
|
-
)
|
|
1274
1284
|
retry (Optional[google.api_core.retry.Retry]):
|
|
1275
1285
|
A description of how to retry the API call.
|
|
1276
1286
|
timeout (Optional[float]):
|
|
@@ -1314,6 +1324,15 @@ class Client(ClientWithProject):
|
|
|
1314
1324
|
must be provided. If a field is listed in ``fields`` and is ``None``
|
|
1315
1325
|
in ``routine``, the field value will be deleted.
|
|
1316
1326
|
|
|
1327
|
+
For example, to update the description property of the routine,
|
|
1328
|
+
specify it in the ``fields`` argument:
|
|
1329
|
+
|
|
1330
|
+
.. code-block:: python
|
|
1331
|
+
|
|
1332
|
+
bigquery_client.update_routine(
|
|
1333
|
+
routine, ["description"]
|
|
1334
|
+
)
|
|
1335
|
+
|
|
1317
1336
|
.. warning::
|
|
1318
1337
|
During beta, partial updates are not supported. You must provide
|
|
1319
1338
|
all fields in the resource.
|
|
@@ -1332,15 +1351,6 @@ class Client(ClientWithProject):
|
|
|
1332
1351
|
fields (Sequence[str]):
|
|
1333
1352
|
The fields of ``routine`` to change, spelled as the
|
|
1334
1353
|
:class:`~google.cloud.bigquery.routine.Routine` properties.
|
|
1335
|
-
|
|
1336
|
-
For example, to update the description property of the routine,
|
|
1337
|
-
specify it in the ``fields`` argument:
|
|
1338
|
-
|
|
1339
|
-
.. code-block:: python
|
|
1340
|
-
|
|
1341
|
-
bigquery_client.update_routine(
|
|
1342
|
-
routine, ["description"]
|
|
1343
|
-
)
|
|
1344
1354
|
retry (Optional[google.api_core.retry.Retry]):
|
|
1345
1355
|
A description of how to retry the API call.
|
|
1346
1356
|
timeout (Optional[float]):
|
|
@@ -1388,6 +1398,16 @@ class Client(ClientWithProject):
|
|
|
1388
1398
|
must be provided. If a field is listed in ``fields`` and is ``None``
|
|
1389
1399
|
in ``table``, the field value will be deleted.
|
|
1390
1400
|
|
|
1401
|
+
For example, to update the descriptive properties of the table,
|
|
1402
|
+
specify them in the ``fields`` argument:
|
|
1403
|
+
|
|
1404
|
+
.. code-block:: python
|
|
1405
|
+
|
|
1406
|
+
bigquery_client.update_table(
|
|
1407
|
+
table,
|
|
1408
|
+
["description", "friendly_name"]
|
|
1409
|
+
)
|
|
1410
|
+
|
|
1391
1411
|
If ``table.etag`` is not ``None``, the update will only succeed if
|
|
1392
1412
|
the table on the server has the same ETag. Thus reading a table with
|
|
1393
1413
|
``get_table``, changing its fields, and then passing it to
|
|
@@ -1399,16 +1419,6 @@ class Client(ClientWithProject):
|
|
|
1399
1419
|
fields (Sequence[str]):
|
|
1400
1420
|
The fields of ``table`` to change, spelled as the
|
|
1401
1421
|
:class:`~google.cloud.bigquery.table.Table` properties.
|
|
1402
|
-
|
|
1403
|
-
For example, to update the descriptive properties of the table,
|
|
1404
|
-
specify them in the ``fields`` argument:
|
|
1405
|
-
|
|
1406
|
-
.. code-block:: python
|
|
1407
|
-
|
|
1408
|
-
bigquery_client.update_table(
|
|
1409
|
-
table,
|
|
1410
|
-
["description", "friendly_name"]
|
|
1411
|
-
)
|
|
1412
1422
|
retry (Optional[google.api_core.retry.Retry]):
|
|
1413
1423
|
A description of how to retry the API call.
|
|
1414
1424
|
timeout (Optional[float]):
|
{google_cloud_bigquery-3.26.0 → google_cloud_bigquery-3.28.0}/google/cloud/bigquery/dataset.py
RENAMED
|
@@ -27,6 +27,7 @@ from google.cloud.bigquery.model import ModelReference
|
|
|
27
27
|
from google.cloud.bigquery.routine import Routine, RoutineReference
|
|
28
28
|
from google.cloud.bigquery.table import Table, TableReference
|
|
29
29
|
from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration
|
|
30
|
+
from google.cloud.bigquery import external_config
|
|
30
31
|
|
|
31
32
|
from typing import Optional, List, Dict, Any, Union
|
|
32
33
|
|
|
@@ -530,6 +531,8 @@ class Dataset(object):
|
|
|
530
531
|
"storage_billing_model": "storageBillingModel",
|
|
531
532
|
"max_time_travel_hours": "maxTimeTravelHours",
|
|
532
533
|
"default_rounding_mode": "defaultRoundingMode",
|
|
534
|
+
"resource_tags": "resourceTags",
|
|
535
|
+
"external_catalog_dataset_options": "externalCatalogDatasetOptions",
|
|
533
536
|
}
|
|
534
537
|
|
|
535
538
|
def __init__(self, dataset_ref) -> None:
|
|
@@ -801,6 +804,28 @@ class Dataset(object):
|
|
|
801
804
|
raise ValueError("Pass a dict")
|
|
802
805
|
self._properties["labels"] = value
|
|
803
806
|
|
|
807
|
+
@property
|
|
808
|
+
def resource_tags(self):
|
|
809
|
+
"""Dict[str, str]: Resource tags of the dataset.
|
|
810
|
+
|
|
811
|
+
Optional. The tags attached to this dataset. Tag keys are globally
|
|
812
|
+
unique. Tag key is expected to be in the namespaced format, for
|
|
813
|
+
example "123456789012/environment" where 123456789012 is
|
|
814
|
+
the ID of the parent organization or project resource for this tag
|
|
815
|
+
key. Tag value is expected to be the short name, for example
|
|
816
|
+
"Production".
|
|
817
|
+
|
|
818
|
+
Raises:
|
|
819
|
+
ValueError: for invalid value types.
|
|
820
|
+
"""
|
|
821
|
+
return self._properties.setdefault("resourceTags", {})
|
|
822
|
+
|
|
823
|
+
@resource_tags.setter
|
|
824
|
+
def resource_tags(self, value):
|
|
825
|
+
if not isinstance(value, dict) and value is not None:
|
|
826
|
+
raise ValueError("Pass a dict")
|
|
827
|
+
self._properties["resourceTags"] = value
|
|
828
|
+
|
|
804
829
|
@property
|
|
805
830
|
def default_encryption_configuration(self):
|
|
806
831
|
"""google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom
|
|
@@ -875,6 +900,29 @@ class Dataset(object):
|
|
|
875
900
|
)
|
|
876
901
|
self._properties["storageBillingModel"] = value
|
|
877
902
|
|
|
903
|
+
@property
|
|
904
|
+
def external_catalog_dataset_options(self):
|
|
905
|
+
"""Options defining open source compatible datasets living in the
|
|
906
|
+
BigQuery catalog. Contains metadata of open source database, schema
|
|
907
|
+
or namespace represented by the current dataset."""
|
|
908
|
+
|
|
909
|
+
prop = _helpers._get_sub_prop(
|
|
910
|
+
self._properties, ["externalCatalogDatasetOptions"]
|
|
911
|
+
)
|
|
912
|
+
|
|
913
|
+
if prop is not None:
|
|
914
|
+
prop = external_config.ExternalCatalogDatasetOptions.from_api_repr(prop)
|
|
915
|
+
return prop
|
|
916
|
+
|
|
917
|
+
@external_catalog_dataset_options.setter
|
|
918
|
+
def external_catalog_dataset_options(self, value):
|
|
919
|
+
value = _helpers._isinstance_or_raise(
|
|
920
|
+
value, external_config.ExternalCatalogDatasetOptions, none_allowed=True
|
|
921
|
+
)
|
|
922
|
+
self._properties[
|
|
923
|
+
self._PROPERTY_TO_API_FIELD["external_catalog_dataset_options"]
|
|
924
|
+
] = (value.to_api_repr() if value is not None else None)
|
|
925
|
+
|
|
878
926
|
@classmethod
|
|
879
927
|
def from_string(cls, full_dataset_id: str) -> "Dataset":
|
|
880
928
|
"""Construct a dataset from fully-qualified dataset ID.
|