Skip to content

Commit 9379285

Browse files
authored
Merge branch 'main' into async-client-project
2 parents 9012fd7 + 53c2cbf commit 9379285

30 files changed

+1253
-191
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:a0c4463fcfd9893fc172a3b3db2b6ac0c7b94ec6ad458c7dcea12d9693615ac3
17-
# created: 2024-02-17T12:21:23.177926195Z
16+
digest: sha256:98f3afd11308259de6e828e37376d18867fd321aba07826e29e4f8d9cab56bad
17+
# created: 2024-02-27T15:56:18.442440378Z

.kokoro/requirements.txt

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -93,39 +93,39 @@ colorlog==6.7.0 \
9393
# via
9494
# gcp-docuploader
9595
# nox
96-
cryptography==42.0.2 \
97-
--hash=sha256:087887e55e0b9c8724cf05361357875adb5c20dec27e5816b653492980d20380 \
98-
--hash=sha256:09a77e5b2e8ca732a19a90c5bca2d124621a1edb5438c5daa2d2738bfeb02589 \
99-
--hash=sha256:130c0f77022b2b9c99d8cebcdd834d81705f61c68e91ddd614ce74c657f8b3ea \
100-
--hash=sha256:141e2aa5ba100d3788c0ad7919b288f89d1fe015878b9659b307c9ef867d3a65 \
101-
--hash=sha256:28cb2c41f131a5758d6ba6a0504150d644054fd9f3203a1e8e8d7ac3aea7f73a \
102-
--hash=sha256:2f9f14185962e6a04ab32d1abe34eae8a9001569ee4edb64d2304bf0d65c53f3 \
103-
--hash=sha256:320948ab49883557a256eab46149df79435a22d2fefd6a66fe6946f1b9d9d008 \
104-
--hash=sha256:36d4b7c4be6411f58f60d9ce555a73df8406d484ba12a63549c88bd64f7967f1 \
105-
--hash=sha256:3b15c678f27d66d247132cbf13df2f75255627bcc9b6a570f7d2fd08e8c081d2 \
106-
--hash=sha256:3dbd37e14ce795b4af61b89b037d4bc157f2cb23e676fa16932185a04dfbf635 \
107-
--hash=sha256:4383b47f45b14459cab66048d384614019965ba6c1a1a141f11b5a551cace1b2 \
108-
--hash=sha256:44c95c0e96b3cb628e8452ec060413a49002a247b2b9938989e23a2c8291fc90 \
109-
--hash=sha256:4b063d3413f853e056161eb0c7724822a9740ad3caa24b8424d776cebf98e7ee \
110-
--hash=sha256:52ed9ebf8ac602385126c9a2fe951db36f2cb0c2538d22971487f89d0de4065a \
111-
--hash=sha256:55d1580e2d7e17f45d19d3b12098e352f3a37fe86d380bf45846ef257054b242 \
112-
--hash=sha256:5ef9bc3d046ce83c4bbf4c25e1e0547b9c441c01d30922d812e887dc5f125c12 \
113-
--hash=sha256:5fa82a26f92871eca593b53359c12ad7949772462f887c35edaf36f87953c0e2 \
114-
--hash=sha256:61321672b3ac7aade25c40449ccedbc6db72c7f5f0fdf34def5e2f8b51ca530d \
115-
--hash=sha256:701171f825dcab90969596ce2af253143b93b08f1a716d4b2a9d2db5084ef7be \
116-
--hash=sha256:841ec8af7a8491ac76ec5a9522226e287187a3107e12b7d686ad354bb78facee \
117-
--hash=sha256:8a06641fb07d4e8f6c7dda4fc3f8871d327803ab6542e33831c7ccfdcb4d0ad6 \
118-
--hash=sha256:8e88bb9eafbf6a4014d55fb222e7360eef53e613215085e65a13290577394529 \
119-
--hash=sha256:a00aee5d1b6c20620161984f8ab2ab69134466c51f58c052c11b076715e72929 \
120-
--hash=sha256:a047682d324ba56e61b7ea7c7299d51e61fd3bca7dad2ccc39b72bd0118d60a1 \
121-
--hash=sha256:a7ef8dd0bf2e1d0a27042b231a3baac6883cdd5557036f5e8df7139255feaac6 \
122-
--hash=sha256:ad28cff53f60d99a928dfcf1e861e0b2ceb2bc1f08a074fdd601b314e1cc9e0a \
123-
--hash=sha256:b9097a208875fc7bbeb1286d0125d90bdfed961f61f214d3f5be62cd4ed8a446 \
124-
--hash=sha256:b97fe7d7991c25e6a31e5d5e795986b18fbbb3107b873d5f3ae6dc9a103278e9 \
125-
--hash=sha256:e0ec52ba3c7f1b7d813cd52649a5b3ef1fc0d433219dc8c93827c57eab6cf888 \
126-
--hash=sha256:ea2c3ffb662fec8bbbfce5602e2c159ff097a4631d96235fcf0fb00e59e3ece4 \
127-
--hash=sha256:fa3dec4ba8fb6e662770b74f62f1a0c7d4e37e25b58b2bf2c1be4c95372b4a33 \
128-
--hash=sha256:fbeb725c9dc799a574518109336acccaf1303c30d45c075c665c0793c2f79a7f
96+
cryptography==42.0.4 \
97+
--hash=sha256:01911714117642a3f1792c7f376db572aadadbafcd8d75bb527166009c9f1d1b \
98+
--hash=sha256:0e89f7b84f421c56e7ff69f11c441ebda73b8a8e6488d322ef71746224c20fce \
99+
--hash=sha256:12d341bd42cdb7d4937b0cabbdf2a94f949413ac4504904d0cdbdce4a22cbf88 \
100+
--hash=sha256:15a1fb843c48b4a604663fa30af60818cd28f895572386e5f9b8a665874c26e7 \
101+
--hash=sha256:1cdcdbd117681c88d717437ada72bdd5be9de117f96e3f4d50dab3f59fd9ab20 \
102+
--hash=sha256:1df6fcbf60560d2113b5ed90f072dc0b108d64750d4cbd46a21ec882c7aefce9 \
103+
--hash=sha256:3c6048f217533d89f2f8f4f0fe3044bf0b2090453b7b73d0b77db47b80af8dff \
104+
--hash=sha256:3e970a2119507d0b104f0a8e281521ad28fc26f2820687b3436b8c9a5fcf20d1 \
105+
--hash=sha256:44a64043f743485925d3bcac548d05df0f9bb445c5fcca6681889c7c3ab12764 \
106+
--hash=sha256:4e36685cb634af55e0677d435d425043967ac2f3790ec652b2b88ad03b85c27b \
107+
--hash=sha256:5f8907fcf57392cd917892ae83708761c6ff3c37a8e835d7246ff0ad251d9298 \
108+
--hash=sha256:69b22ab6506a3fe483d67d1ed878e1602bdd5912a134e6202c1ec672233241c1 \
109+
--hash=sha256:6bfadd884e7280df24d26f2186e4e07556a05d37393b0f220a840b083dc6a824 \
110+
--hash=sha256:6d0fbe73728c44ca3a241eff9aefe6496ab2656d6e7a4ea2459865f2e8613257 \
111+
--hash=sha256:6ffb03d419edcab93b4b19c22ee80c007fb2d708429cecebf1dd3258956a563a \
112+
--hash=sha256:810bcf151caefc03e51a3d61e53335cd5c7316c0a105cc695f0959f2c638b129 \
113+
--hash=sha256:831a4b37accef30cccd34fcb916a5d7b5be3cbbe27268a02832c3e450aea39cb \
114+
--hash=sha256:887623fe0d70f48ab3f5e4dbf234986b1329a64c066d719432d0698522749929 \
115+
--hash=sha256:a0298bdc6e98ca21382afe914c642620370ce0470a01e1bef6dd9b5354c36854 \
116+
--hash=sha256:a1327f280c824ff7885bdeef8578f74690e9079267c1c8bd7dc5cc5aa065ae52 \
117+
--hash=sha256:c1f25b252d2c87088abc8bbc4f1ecbf7c919e05508a7e8628e6875c40bc70923 \
118+
--hash=sha256:c3a5cbc620e1e17009f30dd34cb0d85c987afd21c41a74352d1719be33380885 \
119+
--hash=sha256:ce8613beaffc7c14f091497346ef117c1798c202b01153a8cc7b8e2ebaaf41c0 \
120+
--hash=sha256:d2a27aca5597c8a71abbe10209184e1a8e91c1fd470b5070a2ea60cafec35bcd \
121+
--hash=sha256:dad9c385ba8ee025bb0d856714f71d7840020fe176ae0229de618f14dae7a6e2 \
122+
--hash=sha256:db4b65b02f59035037fde0998974d84244a64c3265bdef32a827ab9b63d61b18 \
123+
--hash=sha256:e09469a2cec88fb7b078e16d4adec594414397e8879a4341c6ace96013463d5b \
124+
--hash=sha256:e53dc41cda40b248ebc40b83b31516487f7db95ab8ceac1f042626bc43a2f992 \
125+
--hash=sha256:f1e85a178384bf19e36779d91ff35c7617c885da487d689b05c1366f9933ad74 \
126+
--hash=sha256:f47be41843200f7faec0683ad751e5ef11b9a56a220d57f300376cd8aba81660 \
127+
--hash=sha256:fb0cef872d8193e487fc6bdb08559c3aa41b659a7d9be48b2e10747f47863925 \
128+
--hash=sha256:ffc73996c4fca3d2b6c1c8c12bfd3ad00def8621da24f547626bf06441400449
129129
# via
130130
# gcp-releasetool
131131
# secretstorage

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@
55
[1]: https://pypi.org/project/google-cloud-bigquery/#history
66

77

8+
## [3.18.0](https://github.com/googleapis/python-bigquery/compare/v3.17.2...v3.18.0) (2024-02-29)
9+
10+
11+
### Features
12+
13+
* Support nullable boolean and Int64 dtypes in `insert_rows_from_dataframe` ([#1816](https://github.com/googleapis/python-bigquery/issues/1816)) ([ab0cf4c](https://github.com/googleapis/python-bigquery/commit/ab0cf4cc03292f62b56a8813cfb7681daa87f872))
14+
* Support slot_ms in QueryPlanEntry ([#1831](https://github.com/googleapis/python-bigquery/issues/1831)) ([d62cabb](https://github.com/googleapis/python-bigquery/commit/d62cabbf115637ecbaf8cc378f39329a5ae74c26))
15+
16+
17+
### Bug Fixes
18+
19+
* Keyword rendering and docstring improvements ([#1829](https://github.com/googleapis/python-bigquery/issues/1829)) ([4dfb920](https://github.com/googleapis/python-bigquery/commit/4dfb920b106784e98f343b3e3fc8e8ff70c50560))
20+
21+
22+
### Documentation
23+
24+
* **samples:** Updates to urllib3 constraint for Python 3.7 ([#1834](https://github.com/googleapis/python-bigquery/issues/1834)) ([b099c32](https://github.com/googleapis/python-bigquery/commit/b099c32a83946a347560f6a71d08c3f263e56cb6))
25+
* Update `client_query_w_named_params.py` to use `query_and_wait` API ([#1782](https://github.com/googleapis/python-bigquery/issues/1782)) ([89dfcb6](https://github.com/googleapis/python-bigquery/commit/89dfcb6469d22e78003a70371a0938a6856e033c))
26+
827
## [3.17.2](https://github.com/googleapis/python-bigquery/compare/v3.17.1...v3.17.2) (2024-01-30)
928

1029

benchmark/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _is_datetime_min(time_str: str) -> bool:
231231

232232

233233
def _summary(run: dict) -> str:
234-
"""Coverts run dict to run summary string."""
234+
"""Converts run dict to run summary string."""
235235
no_val = "NODATA"
236236
output = ["QUERYTIME "]
237237

google/cloud/bigquery/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
from google.cloud.bigquery.query import ConnectionProperty
8484
from google.cloud.bigquery.query import ScalarQueryParameter
8585
from google.cloud.bigquery.query import ScalarQueryParameterType
86+
from google.cloud.bigquery.query import RangeQueryParameter
87+
from google.cloud.bigquery.query import RangeQueryParameterType
8688
from google.cloud.bigquery.query import SqlParameterScalarTypes
8789
from google.cloud.bigquery.query import StructQueryParameter
8890
from google.cloud.bigquery.query import StructQueryParameterType
@@ -122,10 +124,12 @@
122124
"ArrayQueryParameter",
123125
"ScalarQueryParameter",
124126
"StructQueryParameter",
127+
"RangeQueryParameter",
125128
"ArrayQueryParameterType",
126129
"ScalarQueryParameterType",
127130
"SqlParameterScalarTypes",
128131
"StructQueryParameterType",
132+
"RangeQueryParameterType",
129133
# Datasets
130134
"Dataset",
131135
"DatasetReference",

google/cloud/bigquery/_helpers.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from google.cloud._helpers import _RFC3339_MICROS
3131
from google.cloud._helpers import _RFC3339_NO_FRACTION
3232
from google.cloud._helpers import _to_bytes
33+
from google.auth import credentials as ga_credentials # type: ignore
34+
from google.api_core import client_options as client_options_lib
3335

3436
_RFC3339_MICROS_NO_ZULU = "%Y-%m-%dT%H:%M:%S.%f"
3537
_TIMEONLY_WO_MICROS = "%H:%M:%S"
@@ -55,9 +57,63 @@
5557
_DEFAULT_HOST = "https://bigquery.googleapis.com"
5658
"""Default host for JSON API."""
5759

60+
_DEFAULT_HOST_TEMPLATE = "https://bigquery.{UNIVERSE_DOMAIN}"
61+
""" Templatized endpoint format. """
62+
5863
_DEFAULT_UNIVERSE = "googleapis.com"
5964
"""Default universe for the JSON API."""
6065

66+
_UNIVERSE_DOMAIN_ENV = "GOOGLE_CLOUD_UNIVERSE_DOMAIN"
67+
"""Environment variable for setting universe domain."""
68+
69+
70+
def _get_client_universe(
71+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]]
72+
) -> str:
73+
"""Retrieves the specified universe setting.
74+
75+
Args:
76+
client_options: specified client options.
77+
Returns:
78+
str: resolved universe setting.
79+
80+
"""
81+
if isinstance(client_options, dict):
82+
client_options = client_options_lib.from_dict(client_options)
83+
universe = _DEFAULT_UNIVERSE
84+
if hasattr(client_options, "universe_domain"):
85+
options_universe = getattr(client_options, "universe_domain")
86+
if options_universe is not None and len(options_universe) > 0:
87+
universe = options_universe
88+
else:
89+
env_universe = os.getenv(_UNIVERSE_DOMAIN_ENV)
90+
if isinstance(env_universe, str) and len(env_universe) > 0:
91+
universe = env_universe
92+
return universe
93+
94+
95+
def _validate_universe(client_universe: str, credentials: ga_credentials.Credentials):
96+
"""Validates that client provided universe and universe embedded in credentials match.
97+
98+
Args:
99+
client_universe (str): The universe domain configured via the client options.
100+
credentials (ga_credentials.Credentials): The credentials being used in the client.
101+
102+
Raises:
103+
ValueError: when client_universe does not match the universe in credentials.
104+
"""
105+
if hasattr(credentials, "universe_domain"):
106+
cred_universe = getattr(credentials, "universe_domain")
107+
if isinstance(cred_universe, str):
108+
if client_universe != cred_universe:
109+
raise ValueError(
110+
"The configured universe domain "
111+
f"({client_universe}) does not match the universe domain "
112+
f"found in the credentials ({cred_universe}). "
113+
"If you haven't configured the universe domain explicitly, "
114+
f"`{_DEFAULT_UNIVERSE}` is the default."
115+
)
116+
61117

62118
def _get_bigquery_host():
63119
return os.environ.get(BIGQUERY_EMULATOR_HOST, _DEFAULT_HOST)

google/cloud/bigquery/_job_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555

5656
# The purpose of _TIMEOUT_BUFFER_MILLIS is to allow the server-side timeout to
57-
# happen before the client-side timeout. This is not strictly neccessary, as the
57+
# happen before the client-side timeout. This is not strictly necessary, as the
5858
# client retries client-side timeouts, but the hope by making the server-side
5959
# timeout slightly shorter is that it can save the server from some unncessary
6060
# processing time.

0 commit comments

Comments
 (0)