google-cloud-bigquery 3.25.0__tar.gz → 3.27.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.25.0 → google_cloud_bigquery-3.27.0}/MANIFEST.in +1 -1
- {google-cloud-bigquery-3.25.0/google_cloud_bigquery.egg-info → google_cloud_bigquery-3.27.0}/PKG-INFO +11 -13
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/__init__.py +32 -4
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_helpers.py +28 -10
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_pandas_helpers.py +103 -21
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_versions_helpers.py +14 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/client.py +19 -15
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/base.py +6 -3
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/query.py +5 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/magics.py +17 -64
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/query.py +9 -11
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/version.py +1 -1
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0/google_cloud_bigquery.egg-info}/PKG-INFO +11 -13
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google_cloud_bigquery.egg-info/requires.txt +10 -11
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/setup.py +7 -14
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_magics.py +4 -1
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_base.py +18 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test__helpers.py +61 -1
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test__pandas_helpers.py +48 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_job_retry.py +1 -1
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_magics.py +179 -112
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_query.py +19 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_table.py +3 -3
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/LICENSE +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/README.rst +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_http.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_job_helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_pyarrow_helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_tqdm_helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/dataset.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/dbapi/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/dbapi/_helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/dbapi/connection.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/dbapi/cursor.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/dbapi/exceptions.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/dbapi/types.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/encryption_configuration.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/enums.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/exceptions.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/external_config.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/format_options.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/iam.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/copy_.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/extract.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/load.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/line_arg_parser/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/line_arg_parser/exceptions.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/line_arg_parser/lexer.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/line_arg_parser/parser.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/line_arg_parser/visitors.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/model.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/opentelemetry_tracing.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/py.typed +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/retry.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/routine/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/routine/routine.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/schema.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/standard_sql.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/table.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery_v2/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery_v2/types/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery_v2/types/encryption_config.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery_v2/types/model.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery_v2/types/model_reference.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery_v2/types/standard_sql.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery_v2/types/table_reference.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google_cloud_bigquery.egg-info/SOURCES.txt +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google_cloud_bigquery.egg-info/dependency_links.txt +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google_cloud_bigquery.egg-info/not-zip-safe +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google_cloud_bigquery.egg-info/top_level.txt +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/setup.cfg +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/characters.json +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/characters.jsonl +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/colors.avro +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/numeric_38_12.parquet +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/people.csv +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/scalars.csv +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/scalars.jsonl +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/scalars_extreme.jsonl +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/scalars_schema.json +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/scalars_schema_csv.json +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/data/schema.json +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/scrub_datasets.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/conftest.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_arrow.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_client.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_job_retry.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_list_rows.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_pandas.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_query.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/system/test_structs.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/_helpers/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/_helpers/test_from_json.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/conftest.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_copy.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_extract.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_load.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_load_config.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_query.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_query_config.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_query_pandas.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/job/test_query_stats.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/line_arg_parser/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/line_arg_parser/test_lexer.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/line_arg_parser/test_parser.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/line_arg_parser/test_visitors.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/model/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/model/test_model.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/model/test_model_reference.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/routine/__init__.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/routine/test_remote_function_options.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/routine/test_routine.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/routine/test_routine_argument.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/routine/test_routine_reference.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test__http.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test__job_helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test__pyarrow_helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test__versions_helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_client.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_create_dataset.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_dataset.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_dbapi__helpers.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_dbapi_connection.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_dbapi_cursor.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_dbapi_types.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_delete_dataset.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_encryption_configuration.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_external_config.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_format_options.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_legacy_types.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_list_datasets.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_list_jobs.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_list_models.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_list_projects.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_list_routines.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_list_tables.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_opentelemetry_tracing.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_packaging.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_retry.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_schema.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_signature_compatibility.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_standard_sql_types.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_table_arrow.py +0 -0
- {google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/tests/unit/test_table_pandas.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: google-cloud-bigquery
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.27.0
|
|
4
4
|
Summary: Google BigQuery API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/python-bigquery
|
|
6
6
|
Author: Google LLC
|
|
@@ -22,12 +22,12 @@ Classifier: Operating System :: OS Independent
|
|
|
22
22
|
Classifier: Topic :: Internet
|
|
23
23
|
Requires-Python: >=3.7
|
|
24
24
|
License-File: LICENSE
|
|
25
|
-
Requires-Dist: google-api-core[grpc]
|
|
25
|
+
Requires-Dist: google-api-core[grpc]<3.0.0dev,>=2.11.1
|
|
26
26
|
Requires-Dist: google-auth<3.0.0dev,>=2.14.1
|
|
27
|
-
Requires-Dist: google-cloud-core<3.0.0dev,>=
|
|
28
|
-
Requires-Dist: google-resumable-media<3.0dev,>=0.
|
|
27
|
+
Requires-Dist: google-cloud-core<3.0.0dev,>=2.4.1
|
|
28
|
+
Requires-Dist: google-resumable-media<3.0dev,>=2.0.0
|
|
29
29
|
Requires-Dist: packaging>=20.0.0
|
|
30
|
-
Requires-Dist: python-dateutil<3.0dev,>=2.7.
|
|
30
|
+
Requires-Dist: python-dateutil<3.0dev,>=2.7.3
|
|
31
31
|
Requires-Dist: requests<3.0.0dev,>=2.21.0
|
|
32
32
|
Provides-Extra: bqstorage
|
|
33
33
|
Requires-Dist: google-cloud-bigquery-storage<3.0.0dev,>=2.6.0; extra == "bqstorage"
|
|
@@ -46,8 +46,7 @@ Provides-Extra: geopandas
|
|
|
46
46
|
Requires-Dist: geopandas<1.0dev,>=0.9.0; extra == "geopandas"
|
|
47
47
|
Requires-Dist: Shapely<3.0.0dev,>=1.8.4; extra == "geopandas"
|
|
48
48
|
Provides-Extra: ipython
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist: ipykernel>=6.0.0; extra == "ipython"
|
|
49
|
+
Requires-Dist: bigquery-magics>=0.1.0; extra == "ipython"
|
|
51
50
|
Provides-Extra: tqdm
|
|
52
51
|
Requires-Dist: tqdm<5.0.0dev,>=4.7.4; extra == "tqdm"
|
|
53
52
|
Provides-Extra: opentelemetry
|
|
@@ -55,8 +54,8 @@ Requires-Dist: opentelemetry-api>=1.1.0; extra == "opentelemetry"
|
|
|
55
54
|
Requires-Dist: opentelemetry-sdk>=1.1.0; extra == "opentelemetry"
|
|
56
55
|
Requires-Dist: opentelemetry-instrumentation>=0.20b0; extra == "opentelemetry"
|
|
57
56
|
Provides-Extra: bigquery-v2
|
|
58
|
-
Requires-Dist: proto-plus<2.0.0dev,>=1.
|
|
59
|
-
Requires-Dist: protobuf!=
|
|
57
|
+
Requires-Dist: proto-plus<2.0.0dev,>=1.22.3; extra == "bigquery-v2"
|
|
58
|
+
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"
|
|
60
59
|
Provides-Extra: all
|
|
61
60
|
Requires-Dist: google-cloud-bigquery-storage<3.0.0dev,>=2.6.0; extra == "all"
|
|
62
61
|
Requires-Dist: grpcio<2.0dev,>=1.47.0; extra == "all"
|
|
@@ -70,14 +69,13 @@ Requires-Dist: ipywidgets>=7.7.0; extra == "all"
|
|
|
70
69
|
Requires-Dist: ipykernel>=6.0.0; extra == "all"
|
|
71
70
|
Requires-Dist: geopandas<1.0dev,>=0.9.0; extra == "all"
|
|
72
71
|
Requires-Dist: Shapely<3.0.0dev,>=1.8.4; extra == "all"
|
|
73
|
-
Requires-Dist:
|
|
74
|
-
Requires-Dist: ipykernel>=6.0.0; extra == "all"
|
|
72
|
+
Requires-Dist: bigquery-magics>=0.1.0; extra == "all"
|
|
75
73
|
Requires-Dist: tqdm<5.0.0dev,>=4.7.4; extra == "all"
|
|
76
74
|
Requires-Dist: opentelemetry-api>=1.1.0; extra == "all"
|
|
77
75
|
Requires-Dist: opentelemetry-sdk>=1.1.0; extra == "all"
|
|
78
76
|
Requires-Dist: opentelemetry-instrumentation>=0.20b0; extra == "all"
|
|
79
|
-
Requires-Dist: proto-plus<2.0.0dev,>=1.
|
|
80
|
-
Requires-Dist: protobuf!=
|
|
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"
|
|
81
79
|
|
|
82
80
|
Python Client for Google BigQuery
|
|
83
81
|
=================================
|
{google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/__init__.py
RENAMED
|
@@ -27,6 +27,7 @@ The main concepts with this API are:
|
|
|
27
27
|
- :class:`~google.cloud.bigquery.table.Table` represents a single "relation".
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
|
+
import warnings
|
|
30
31
|
|
|
31
32
|
from google.cloud.bigquery import version as bigquery_version
|
|
32
33
|
|
|
@@ -43,6 +44,7 @@ from google.cloud.bigquery.enums import KeyResultStatementKind
|
|
|
43
44
|
from google.cloud.bigquery.enums import SqlTypeNames
|
|
44
45
|
from google.cloud.bigquery.enums import StandardSqlTypeNames
|
|
45
46
|
from google.cloud.bigquery.exceptions import LegacyBigQueryStorageError
|
|
47
|
+
from google.cloud.bigquery.exceptions import LegacyPandasError
|
|
46
48
|
from google.cloud.bigquery.exceptions import LegacyPyarrowError
|
|
47
49
|
from google.cloud.bigquery.external_config import ExternalConfig
|
|
48
50
|
from google.cloud.bigquery.external_config import BigtableOptions
|
|
@@ -113,6 +115,24 @@ from google.cloud.bigquery.table import TableReference
|
|
|
113
115
|
from google.cloud.bigquery.table import TimePartitioningType
|
|
114
116
|
from google.cloud.bigquery.table import TimePartitioning
|
|
115
117
|
from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration
|
|
118
|
+
from google.cloud.bigquery import _versions_helpers
|
|
119
|
+
|
|
120
|
+
try:
|
|
121
|
+
import bigquery_magics # type: ignore
|
|
122
|
+
except ImportError:
|
|
123
|
+
bigquery_magics = None
|
|
124
|
+
|
|
125
|
+
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
|
|
126
|
+
|
|
127
|
+
if sys_major == 3 and sys_minor in (7, 8):
|
|
128
|
+
warnings.warn(
|
|
129
|
+
"The python-bigquery library will stop supporting Python 3.7 "
|
|
130
|
+
"and Python 3.8 in a future major release expected in Q4 2024. "
|
|
131
|
+
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
|
|
132
|
+
"recommend that you update soon to ensure ongoing support. For "
|
|
133
|
+
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
|
|
134
|
+
PendingDeprecationWarning,
|
|
135
|
+
)
|
|
116
136
|
|
|
117
137
|
__all__ = [
|
|
118
138
|
"__version__",
|
|
@@ -214,8 +234,16 @@ __all__ = [
|
|
|
214
234
|
|
|
215
235
|
def load_ipython_extension(ipython):
|
|
216
236
|
"""Called by IPython when this module is loaded as an IPython extension."""
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
_cell_magic, magic_kind="cell", magic_name="bigquery"
|
|
237
|
+
warnings.warn(
|
|
238
|
+
"%load_ext google.cloud.bigquery is deprecated. Install bigquery-magics package and use `%load_ext bigquery_magics`, instead.",
|
|
239
|
+
category=FutureWarning,
|
|
221
240
|
)
|
|
241
|
+
|
|
242
|
+
if bigquery_magics is not None:
|
|
243
|
+
bigquery_magics.load_ipython_extension(ipython)
|
|
244
|
+
else:
|
|
245
|
+
from google.cloud.bigquery.magics.magics import _cell_magic
|
|
246
|
+
|
|
247
|
+
ipython.register_magic_function(
|
|
248
|
+
_cell_magic, magic_kind="cell", magic_name="bigquery"
|
|
249
|
+
)
|
{google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/_helpers.py
RENAMED
|
@@ -21,6 +21,7 @@ import json
|
|
|
21
21
|
import math
|
|
22
22
|
import re
|
|
23
23
|
import os
|
|
24
|
+
import warnings
|
|
24
25
|
from typing import Optional, Union
|
|
25
26
|
|
|
26
27
|
from dateutil import relativedelta
|
|
@@ -297,12 +298,7 @@ def _record_from_json(value, field):
|
|
|
297
298
|
record = {}
|
|
298
299
|
record_iter = zip(field.fields, value["f"])
|
|
299
300
|
for subfield, cell in record_iter:
|
|
300
|
-
|
|
301
|
-
if subfield.mode == "REPEATED":
|
|
302
|
-
value = [converter(item["v"], subfield) for item in cell["v"]]
|
|
303
|
-
else:
|
|
304
|
-
value = converter(cell["v"], subfield)
|
|
305
|
-
record[subfield.name] = value
|
|
301
|
+
record[subfield.name] = _field_from_json(cell["v"], subfield)
|
|
306
302
|
return record
|
|
307
303
|
|
|
308
304
|
|
|
@@ -382,7 +378,11 @@ def _field_to_index_mapping(schema):
|
|
|
382
378
|
|
|
383
379
|
|
|
384
380
|
def _field_from_json(resource, field):
|
|
385
|
-
|
|
381
|
+
def default_converter(value, field):
|
|
382
|
+
_warn_unknown_field_type(field)
|
|
383
|
+
return value
|
|
384
|
+
|
|
385
|
+
converter = _CELLDATA_FROM_JSON.get(field.field_type, default_converter)
|
|
386
386
|
if field.mode == "REPEATED":
|
|
387
387
|
return [converter(item["v"], field) for item in resource]
|
|
388
388
|
else:
|
|
@@ -484,6 +484,11 @@ def _json_to_json(value):
|
|
|
484
484
|
return json.dumps(value)
|
|
485
485
|
|
|
486
486
|
|
|
487
|
+
def _string_to_json(value):
|
|
488
|
+
"""NOOP string -> string coercion"""
|
|
489
|
+
return value
|
|
490
|
+
|
|
491
|
+
|
|
487
492
|
def _timestamp_to_json_parameter(value):
|
|
488
493
|
"""Coerce 'value' to an JSON-compatible representation.
|
|
489
494
|
|
|
@@ -596,6 +601,7 @@ _SCALAR_VALUE_TO_JSON_ROW = {
|
|
|
596
601
|
"DATE": _date_to_json,
|
|
597
602
|
"TIME": _time_to_json,
|
|
598
603
|
"JSON": _json_to_json,
|
|
604
|
+
"STRING": _string_to_json,
|
|
599
605
|
# Make sure DECIMAL and BIGDECIMAL are handled, even though
|
|
600
606
|
# requests for them should be converted to NUMERIC. Better safe
|
|
601
607
|
# than sorry.
|
|
@@ -609,6 +615,15 @@ _SCALAR_VALUE_TO_JSON_PARAM = _SCALAR_VALUE_TO_JSON_ROW.copy()
|
|
|
609
615
|
_SCALAR_VALUE_TO_JSON_PARAM["TIMESTAMP"] = _timestamp_to_json_parameter
|
|
610
616
|
|
|
611
617
|
|
|
618
|
+
def _warn_unknown_field_type(field):
|
|
619
|
+
warnings.warn(
|
|
620
|
+
"Unknown type '{}' for field '{}'. Behavior reading and writing this type is not officially supported and may change in the future.".format(
|
|
621
|
+
field.field_type, field.name
|
|
622
|
+
),
|
|
623
|
+
FutureWarning,
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
|
|
612
627
|
def _scalar_field_to_json(field, row_value):
|
|
613
628
|
"""Maps a field and value to a JSON-safe value.
|
|
614
629
|
|
|
@@ -621,9 +636,12 @@ def _scalar_field_to_json(field, row_value):
|
|
|
621
636
|
Returns:
|
|
622
637
|
Any: A JSON-serializable object.
|
|
623
638
|
"""
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
639
|
+
|
|
640
|
+
def default_converter(value):
|
|
641
|
+
_warn_unknown_field_type(field)
|
|
642
|
+
return value
|
|
643
|
+
|
|
644
|
+
converter = _SCALAR_VALUE_TO_JSON_ROW.get(field.field_type, default_converter)
|
|
627
645
|
return converter(row_value)
|
|
628
646
|
|
|
629
647
|
|
|
@@ -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:
|
|
@@ -200,11 +201,13 @@ def bq_to_arrow_field(bq_field, array_type=None):
|
|
|
200
201
|
# local NULL values. Arrow will gladly interpret these NULL values
|
|
201
202
|
# as non-NULL and give you an arbitrary value. See:
|
|
202
203
|
# https://github.com/googleapis/python-bigquery/issues/1692
|
|
203
|
-
nullable=True,
|
|
204
|
+
nullable=False if bq_field.mode.upper() == "REPEATED" else True,
|
|
204
205
|
metadata=metadata,
|
|
205
206
|
)
|
|
206
207
|
|
|
207
|
-
warnings.warn(
|
|
208
|
+
warnings.warn(
|
|
209
|
+
"Unable to determine Arrow type for field '{}'.".format(bq_field.name)
|
|
210
|
+
)
|
|
208
211
|
return None
|
|
209
212
|
|
|
210
213
|
|
|
@@ -814,18 +817,54 @@ def _nowait(futures):
|
|
|
814
817
|
|
|
815
818
|
|
|
816
819
|
def _download_table_bqstorage(
|
|
817
|
-
project_id,
|
|
818
|
-
table,
|
|
819
|
-
bqstorage_client,
|
|
820
|
-
preserve_order=False,
|
|
821
|
-
selected_fields=None,
|
|
822
|
-
page_to_item=None,
|
|
823
|
-
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
824
|
-
|
|
825
|
-
|
|
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
|
+
"""
|
|
826
867
|
|
|
827
|
-
# Passing a BQ Storage client in implies that the BigQuery Storage library
|
|
828
|
-
# is available and can be imported.
|
|
829
868
|
from google.cloud import bigquery_storage
|
|
830
869
|
|
|
831
870
|
if "$" in table.table_id:
|
|
@@ -835,10 +874,11 @@ def _download_table_bqstorage(
|
|
|
835
874
|
if "@" in table.table_id:
|
|
836
875
|
raise ValueError("Reading from a specific snapshot is not currently supported.")
|
|
837
876
|
|
|
838
|
-
requested_streams =
|
|
877
|
+
requested_streams = determine_requested_streams(preserve_order, max_stream_count)
|
|
839
878
|
|
|
840
|
-
requested_session = bigquery_storage.types.ReadSession(
|
|
841
|
-
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,
|
|
842
882
|
)
|
|
843
883
|
if selected_fields is not None:
|
|
844
884
|
for field in selected_fields:
|
|
@@ -846,7 +886,8 @@ def _download_table_bqstorage(
|
|
|
846
886
|
|
|
847
887
|
if _ARROW_COMPRESSION_SUPPORT:
|
|
848
888
|
requested_session.read_options.arrow_serialization_options.buffer_compression = (
|
|
849
|
-
|
|
889
|
+
# CompressionCodec(1) -> LZ4_FRAME
|
|
890
|
+
ArrowSerializationOptions.CompressionCodec(1)
|
|
850
891
|
)
|
|
851
892
|
|
|
852
893
|
session = bqstorage_client.create_read_session(
|
|
@@ -882,7 +923,7 @@ def _download_table_bqstorage(
|
|
|
882
923
|
elif max_queue_size is None:
|
|
883
924
|
max_queue_size = 0 # unbounded
|
|
884
925
|
|
|
885
|
-
worker_queue = queue.Queue(maxsize=max_queue_size)
|
|
926
|
+
worker_queue: queue.Queue[int] = queue.Queue(maxsize=max_queue_size)
|
|
886
927
|
|
|
887
928
|
with concurrent.futures.ThreadPoolExecutor(max_workers=total_streams) as pool:
|
|
888
929
|
try:
|
|
@@ -908,7 +949,7 @@ def _download_table_bqstorage(
|
|
|
908
949
|
# we want to block on the queue's get method, instead. This
|
|
909
950
|
# prevents the queue from filling up, because the main thread
|
|
910
951
|
# has smaller gaps in time between calls to the queue's get
|
|
911
|
-
# method. For a detailed
|
|
952
|
+
# method. For a detailed explanation, see:
|
|
912
953
|
# https://friendliness.dev/2019/06/18/python-nowait/
|
|
913
954
|
done, not_done = _nowait(not_done)
|
|
914
955
|
for future in done:
|
|
@@ -947,6 +988,7 @@ def download_arrow_bqstorage(
|
|
|
947
988
|
preserve_order=False,
|
|
948
989
|
selected_fields=None,
|
|
949
990
|
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
991
|
+
max_stream_count=None,
|
|
950
992
|
):
|
|
951
993
|
return _download_table_bqstorage(
|
|
952
994
|
project_id,
|
|
@@ -956,6 +998,7 @@ def download_arrow_bqstorage(
|
|
|
956
998
|
selected_fields=selected_fields,
|
|
957
999
|
page_to_item=_bqstorage_page_to_arrow,
|
|
958
1000
|
max_queue_size=max_queue_size,
|
|
1001
|
+
max_stream_count=max_stream_count,
|
|
959
1002
|
)
|
|
960
1003
|
|
|
961
1004
|
|
|
@@ -968,6 +1011,7 @@ def download_dataframe_bqstorage(
|
|
|
968
1011
|
preserve_order=False,
|
|
969
1012
|
selected_fields=None,
|
|
970
1013
|
max_queue_size=_MAX_QUEUE_SIZE_DEFAULT,
|
|
1014
|
+
max_stream_count=None,
|
|
971
1015
|
):
|
|
972
1016
|
page_to_item = functools.partial(_bqstorage_page_to_dataframe, column_names, dtypes)
|
|
973
1017
|
return _download_table_bqstorage(
|
|
@@ -978,6 +1022,7 @@ def download_dataframe_bqstorage(
|
|
|
978
1022
|
selected_fields=selected_fields,
|
|
979
1023
|
page_to_item=page_to_item,
|
|
980
1024
|
max_queue_size=max_queue_size,
|
|
1025
|
+
max_stream_count=max_stream_count,
|
|
981
1026
|
)
|
|
982
1027
|
|
|
983
1028
|
|
|
@@ -1022,3 +1067,40 @@ def verify_pandas_imports():
|
|
|
1022
1067
|
raise ValueError(_NO_PANDAS_ERROR) from pandas_import_exception
|
|
1023
1068
|
if db_dtypes is None:
|
|
1024
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
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
"""Shared helper functions for verifying versions of installed modules."""
|
|
16
16
|
|
|
17
|
+
import sys
|
|
17
18
|
from typing import Any
|
|
18
19
|
|
|
19
20
|
import packaging.version
|
|
@@ -248,3 +249,16 @@ SUPPORTS_RANGE_PYARROW = (
|
|
|
248
249
|
and PYARROW_VERSIONS.try_import() is not None
|
|
249
250
|
and PYARROW_VERSIONS.installed_version >= _MIN_PYARROW_VERSION_RANGE
|
|
250
251
|
)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def extract_runtime_version():
|
|
255
|
+
# Retrieve the version information
|
|
256
|
+
version_info = sys.version_info
|
|
257
|
+
|
|
258
|
+
# Extract the major, minor, and micro components
|
|
259
|
+
major = version_info.major
|
|
260
|
+
minor = version_info.minor
|
|
261
|
+
micro = version_info.micro
|
|
262
|
+
|
|
263
|
+
# Display the version number in a clear format
|
|
264
|
+
return major, minor, micro
|
{google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/client.py
RENAMED
|
@@ -328,6 +328,15 @@ class Client(ClientWithProject):
|
|
|
328
328
|
) -> str:
|
|
329
329
|
"""Get the email address of the project's BigQuery service account
|
|
330
330
|
|
|
331
|
+
Example:
|
|
332
|
+
|
|
333
|
+
.. code-block:: python
|
|
334
|
+
|
|
335
|
+
from google.cloud import bigquery
|
|
336
|
+
client = bigquery.Client()
|
|
337
|
+
client.get_service_account_email()
|
|
338
|
+
# returns an email similar to: my_service_account@my-project.iam.gserviceaccount.com
|
|
339
|
+
|
|
331
340
|
Note:
|
|
332
341
|
This is the service account that BigQuery uses to manage tables
|
|
333
342
|
encrypted by a key in KMS.
|
|
@@ -345,13 +354,6 @@ class Client(ClientWithProject):
|
|
|
345
354
|
str:
|
|
346
355
|
service account email address
|
|
347
356
|
|
|
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
357
|
"""
|
|
356
358
|
if project is None:
|
|
357
359
|
project = self.project
|
|
@@ -629,9 +631,19 @@ class Client(ClientWithProject):
|
|
|
629
631
|
) -> Dataset:
|
|
630
632
|
"""API call: create the dataset via a POST request.
|
|
631
633
|
|
|
634
|
+
|
|
632
635
|
See
|
|
633
636
|
https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/insert
|
|
634
637
|
|
|
638
|
+
Example:
|
|
639
|
+
|
|
640
|
+
.. code-block:: python
|
|
641
|
+
|
|
642
|
+
from google.cloud import bigquery
|
|
643
|
+
client = bigquery.Client()
|
|
644
|
+
dataset = bigquery.Dataset('my_project.my_dataset')
|
|
645
|
+
dataset = client.create_dataset(dataset)
|
|
646
|
+
|
|
635
647
|
Args:
|
|
636
648
|
dataset (Union[ \
|
|
637
649
|
google.cloud.bigquery.dataset.Dataset, \
|
|
@@ -658,14 +670,6 @@ class Client(ClientWithProject):
|
|
|
658
670
|
Raises:
|
|
659
671
|
google.cloud.exceptions.Conflict:
|
|
660
672
|
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
673
|
"""
|
|
670
674
|
dataset = self._dataset_from_arg(dataset)
|
|
671
675
|
if isinstance(dataset, DatasetReference):
|
{google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/base.py
RENAMED
|
@@ -49,7 +49,7 @@ _ERROR_REASON_TO_EXCEPTION = {
|
|
|
49
49
|
"notImplemented": http.client.NOT_IMPLEMENTED,
|
|
50
50
|
"policyViolation": http.client.FORBIDDEN,
|
|
51
51
|
"quotaExceeded": http.client.FORBIDDEN,
|
|
52
|
-
"rateLimitExceeded": http.client.
|
|
52
|
+
"rateLimitExceeded": http.client.TOO_MANY_REQUESTS,
|
|
53
53
|
"resourceInUse": http.client.BAD_REQUEST,
|
|
54
54
|
"resourcesExceeded": http.client.BAD_REQUEST,
|
|
55
55
|
"responseTooLarge": http.client.FORBIDDEN,
|
|
@@ -218,8 +218,11 @@ class _JobConfig(object):
|
|
|
218
218
|
err.__traceback__
|
|
219
219
|
)
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
if value is not None:
|
|
222
|
+
# docs indicate a string is expected by the API
|
|
223
|
+
self._properties["jobTimeoutMs"] = str(value)
|
|
224
|
+
else:
|
|
225
|
+
self._properties.pop("jobTimeoutMs", None)
|
|
223
226
|
|
|
224
227
|
@property
|
|
225
228
|
def labels(self):
|
{google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/job/query.py
RENAMED
|
@@ -476,6 +476,11 @@ class QueryJobConfig(_JobConfig):
|
|
|
476
476
|
ID, each separated by ``.``. For example:
|
|
477
477
|
``your-project.your_dataset.your_table``.
|
|
478
478
|
|
|
479
|
+
.. note::
|
|
480
|
+
|
|
481
|
+
Only table ID is passed to the backend, so any configuration
|
|
482
|
+
in `~google.cloud.bigquery.table.Table` is discarded.
|
|
483
|
+
|
|
479
484
|
See
|
|
480
485
|
https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationQuery.FIELDS.destination_table
|
|
481
486
|
"""
|
{google-cloud-bigquery-3.25.0 → google_cloud_bigquery-3.27.0}/google/cloud/bigquery/magics/magics.py
RENAMED
|
@@ -14,70 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
"""IPython Magics
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
IPython cell magic to run a query and display the result as a DataFrame
|
|
20
|
-
|
|
21
|
-
.. code-block:: python
|
|
22
|
-
|
|
23
|
-
%%bigquery [<destination_var>] [--project <project>] [--use_legacy_sql]
|
|
24
|
-
[--verbose] [--params <params>]
|
|
25
|
-
<query>
|
|
26
|
-
|
|
27
|
-
Parameters:
|
|
28
|
-
|
|
29
|
-
* ``<destination_var>`` (Optional[line argument]):
|
|
30
|
-
variable to store the query results. The results are not displayed if
|
|
31
|
-
this parameter is used. If an error occurs during the query execution,
|
|
32
|
-
the corresponding ``QueryJob`` instance (if available) is stored in
|
|
33
|
-
the variable instead.
|
|
34
|
-
* ``--destination_table`` (Optional[line argument]):
|
|
35
|
-
A dataset and table to store the query results. If table does not exists,
|
|
36
|
-
it will be created. If table already exists, its data will be overwritten.
|
|
37
|
-
Variable should be in a format <dataset_id>.<table_id>.
|
|
38
|
-
* ``--no_query_cache`` (Optional[line argument]):
|
|
39
|
-
Do not use cached query results.
|
|
40
|
-
* ``--project <project>`` (Optional[line argument]):
|
|
41
|
-
Project to use for running the query. Defaults to the context
|
|
42
|
-
:attr:`~google.cloud.bigquery.magics.Context.project`.
|
|
43
|
-
* ``--use_bqstorage_api`` (Optional[line argument]):
|
|
44
|
-
[Deprecated] Not used anymore, as BigQuery Storage API is used by default.
|
|
45
|
-
* ``--use_rest_api`` (Optional[line argument]):
|
|
46
|
-
Use the BigQuery REST API instead of the Storage API.
|
|
47
|
-
* ``--use_legacy_sql`` (Optional[line argument]):
|
|
48
|
-
Runs the query using Legacy SQL syntax. Defaults to Standard SQL if
|
|
49
|
-
this argument not used.
|
|
50
|
-
* ``--verbose`` (Optional[line argument]):
|
|
51
|
-
If this flag is used, information including the query job ID and the
|
|
52
|
-
amount of time for the query to complete will not be cleared after the
|
|
53
|
-
query is finished. By default, this information will be displayed but
|
|
54
|
-
will be cleared after the query is finished.
|
|
55
|
-
* ``--params <params>`` (Optional[line argument]):
|
|
56
|
-
If present, the argument following the ``--params`` flag must be
|
|
57
|
-
either:
|
|
58
|
-
|
|
59
|
-
* :class:`str` - A JSON string representation of a dictionary in the
|
|
60
|
-
format ``{"param_name": "param_value"}`` (ex. ``{"num": 17}``). Use
|
|
61
|
-
of the parameter in the query should be indicated with
|
|
62
|
-
``@param_name``. See ``In[5]`` in the Examples section below.
|
|
63
|
-
|
|
64
|
-
* :class:`dict` reference - A reference to a ``dict`` in the format
|
|
65
|
-
``{"param_name": "param_value"}``, where the value types must be JSON
|
|
66
|
-
serializable. The variable reference is indicated by a ``$`` before
|
|
67
|
-
the variable name (ex. ``$my_dict_var``). See ``In[6]`` and ``In[7]``
|
|
68
|
-
in the Examples section below.
|
|
69
|
-
|
|
70
|
-
* ``<query>`` (required, cell argument):
|
|
71
|
-
SQL query to run. If the query does not contain any whitespace (aside
|
|
72
|
-
from leading and trailing whitespace), it is assumed to represent a
|
|
73
|
-
fully-qualified table ID, and the latter's data will be fetched.
|
|
17
|
+
Install ``bigquery-magics`` and call ``%load_ext bigquery_magics`` to use the
|
|
18
|
+
``%%bigquery`` cell magic.
|
|
74
19
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.. note::
|
|
79
|
-
All queries run using this magic will run using the context
|
|
80
|
-
:attr:`~google.cloud.bigquery.magics.Context.credentials`.
|
|
20
|
+
See the `BigQuery Magics reference documentation
|
|
21
|
+
<https://googleapis.dev/python/bigquery-magics/latest/>`_.
|
|
81
22
|
"""
|
|
82
23
|
|
|
83
24
|
from __future__ import print_function
|
|
@@ -109,6 +50,11 @@ from google.cloud.bigquery import exceptions
|
|
|
109
50
|
from google.cloud.bigquery.dbapi import _helpers
|
|
110
51
|
from google.cloud.bigquery.magics import line_arg_parser as lap
|
|
111
52
|
|
|
53
|
+
try:
|
|
54
|
+
import bigquery_magics # type: ignore
|
|
55
|
+
except ImportError:
|
|
56
|
+
bigquery_magics = None
|
|
57
|
+
|
|
112
58
|
|
|
113
59
|
IPYTHON_USER_AGENT = "ipython-{}".format(IPython.__version__)
|
|
114
60
|
|
|
@@ -280,7 +226,14 @@ class Context(object):
|
|
|
280
226
|
self._progress_bar_type = value
|
|
281
227
|
|
|
282
228
|
|
|
283
|
-
|
|
229
|
+
# If bigquery_magics is available, we load that extension rather than this one.
|
|
230
|
+
# Ensure google.cloud.bigquery.magics.context setters are on the correct magics
|
|
231
|
+
# implementation in case the user has installed the package but hasn't updated
|
|
232
|
+
# their code.
|
|
233
|
+
if bigquery_magics is not None:
|
|
234
|
+
context = bigquery_magics.context
|
|
235
|
+
else:
|
|
236
|
+
context = Context()
|
|
284
237
|
|
|
285
238
|
|
|
286
239
|
def _handle_error(error, destination_var=None):
|