Skip to content

Commit 19f0154

Browse files
authored
Merge branch 'main' into tswast-b247809965
2 parents 26befd4 + cbbfeb5 commit 19f0154

31 files changed

+419
-176
lines changed

.github/.OwlBot.lock.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:c43f1d918bcf817d337aa29ff833439494a158a0831508fda4ec75dc4c0d0320
16+
digest: sha256:8555f0e37e6261408f792bfd6635102d2da5ad73f8f09bcb24f25e6afb5fac97

.kokoro/requirements.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
gcp-docuploader
2-
gcp-releasetool
2+
gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x
33
importlib-metadata
44
typing-extensions
55
twine

.kokoro/requirements.txt

+25-30
Original file line numberDiff line numberDiff line change
@@ -113,33 +113,28 @@ commonmark==0.9.1 \
113113
--hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \
114114
--hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9
115115
# via rich
116-
cryptography==38.0.3 \
117-
--hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \
118-
--hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \
119-
--hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \
120-
--hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \
121-
--hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \
122-
--hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \
123-
--hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \
124-
--hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \
125-
--hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \
126-
--hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \
127-
--hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \
128-
--hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \
129-
--hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \
130-
--hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \
131-
--hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \
132-
--hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \
133-
--hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \
134-
--hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \
135-
--hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \
136-
--hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \
137-
--hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \
138-
--hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \
139-
--hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \
140-
--hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \
141-
--hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \
142-
--hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722
116+
cryptography==39.0.1 \
117+
--hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \
118+
--hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \
119+
--hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \
120+
--hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \
121+
--hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \
122+
--hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \
123+
--hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \
124+
--hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \
125+
--hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \
126+
--hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \
127+
--hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \
128+
--hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \
129+
--hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \
130+
--hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \
131+
--hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \
132+
--hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \
133+
--hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \
134+
--hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \
135+
--hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \
136+
--hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \
137+
--hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8
143138
# via
144139
# gcp-releasetool
145140
# secretstorage
@@ -159,9 +154,9 @@ gcp-docuploader==0.6.4 \
159154
--hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \
160155
--hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf
161156
# via -r requirements.in
162-
gcp-releasetool==1.10.0 \
163-
--hash=sha256:72a38ca91b59c24f7e699e9227c90cbe4dd71b789383cb0164b088abae294c83 \
164-
--hash=sha256:8c7c99320208383d4bb2b808c6880eb7a81424afe7cdba3c8d84b25f4f0e097d
157+
gcp-releasetool==1.10.5 \
158+
--hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \
159+
--hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9
165160
# via -r requirements.in
166161
google-api-core==2.10.2 \
167162
--hash=sha256:10c06f7739fe57781f87523375e8e1a3a4674bf6392cd6131a3222182b971320 \

CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,40 @@
55
[1]: https://pypi.org/project/google-cloud-bigquery/#history
66

77

8+
## [3.6.0](https://github.com/googleapis/python-bigquery/compare/v3.5.0...v3.6.0) (2023-02-22)
9+
10+
11+
### Features
12+
13+
* Adding preserveAsciiControlCharacter to CSVOptions ([#1491](https://github.com/googleapis/python-bigquery/issues/1491)) ([f832e7a](https://github.com/googleapis/python-bigquery/commit/f832e7a0b79f3567a0773ff11630e2f48bed60db))
14+
15+
16+
### Bug Fixes
17+
18+
* Annotate optional integer parameters with optional type ([#1487](https://github.com/googleapis/python-bigquery/issues/1487)) ([a190aaa](https://github.com/googleapis/python-bigquery/commit/a190aaa09ae73e8b6a83b7b213247f95fde57615))
19+
* Loosen ipywidget dependency ([#1504](https://github.com/googleapis/python-bigquery/issues/1504)) ([20d3276](https://github.com/googleapis/python-bigquery/commit/20d3276cc29e9467eef9476d5fd572099d9a3f6f))
20+
* Removes scope to avoid unnecessary duplication ([#1503](https://github.com/googleapis/python-bigquery/issues/1503)) ([665d7ba](https://github.com/googleapis/python-bigquery/commit/665d7ba74a1b45de1ef51cc75b6860125afc5fe6))
21+
22+
23+
### Dependencies
24+
25+
* Update minimum google-cloud-core to 1.6.0 ([a190aaa](https://github.com/googleapis/python-bigquery/commit/a190aaa09ae73e8b6a83b7b213247f95fde57615))
26+
27+
## [3.5.0](https://github.com/googleapis/python-bigquery/compare/v3.4.2...v3.5.0) (2023-01-31)
28+
29+
30+
### Features
31+
32+
* Add __str__ method to DatasetReference ([#1477](https://github.com/googleapis/python-bigquery/issues/1477)) ([f32df1f](https://github.com/googleapis/python-bigquery/commit/f32df1fb74e4aea24cd8a4099040ad2f7436e54d))
33+
* Add preserveAsciiControlCharacter to LoadJobConfig ([#1484](https://github.com/googleapis/python-bigquery/issues/1484)) ([bd1da9a](https://github.com/googleapis/python-bigquery/commit/bd1da9aa0a40b02b7d5409a0b094d8380e255c91))
34+
35+
36+
### Documentation
37+
38+
* Adds snippet for creating table with external data config ([#1420](https://github.com/googleapis/python-bigquery/issues/1420)) ([f0ace2a](https://github.com/googleapis/python-bigquery/commit/f0ace2ac2307ef359511a235f80f5ce9e46264c1))
39+
* Revise delete label table code sample, add TODO to clean up sni… ([#1466](https://github.com/googleapis/python-bigquery/issues/1466)) ([0dab7d2](https://github.com/googleapis/python-bigquery/commit/0dab7d25ace4b63d2984485e7b0c5bb38f20476f))
40+
* **samples:** Table variable fix ([#1287](https://github.com/googleapis/python-bigquery/issues/1287)) ([a71888a](https://github.com/googleapis/python-bigquery/commit/a71888a60d1e5e5815ab459fe24368ad5b0d032a))
41+
842
## [3.4.2](https://github.com/googleapis/python-bigquery/compare/v3.4.1...v3.4.2) (2023-01-13)
943

1044

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies.
5252

5353
Supported Python Versions
5454
^^^^^^^^^^^^^^^^^^^^^^^^^
55-
Python >= 3.7, < 3.11
55+
Python >= 3.7
5656

5757
Unsupported Python Versions
5858
^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/snippets.py

-60
Original file line numberDiff line numberDiff line change
@@ -164,66 +164,6 @@ def test_create_partitioned_table(client, to_delete):
164164
"https://github.com/GoogleCloudPlatform/google-cloud-python/issues/5589"
165165
)
166166
)
167-
def test_manage_table_labels(client, to_delete):
168-
dataset_id = "label_table_dataset_{}".format(_millis())
169-
table_id = "label_table_{}".format(_millis())
170-
project = client.project
171-
dataset_ref = bigquery.DatasetReference(project, dataset_id)
172-
dataset = bigquery.Dataset(dataset_ref)
173-
client.create_dataset(dataset)
174-
to_delete.append(dataset)
175-
176-
table = bigquery.Table(dataset.table(table_id), schema=SCHEMA)
177-
178-
labels = {"color": "green"}
179-
table.labels = labels
180-
table = client.create_table(table)
181-
182-
# TODO(Mattix23): After code sample is updated from cloud.google.com delete this
183-
184-
# [START bigquery_get_table_labels]
185-
# from google.cloud import bigquery
186-
# client = bigquery.Client()
187-
# dataset_id = 'my_dataset'
188-
# table_id = 'my_table'
189-
190-
project = client.project
191-
dataset_ref = bigquery.DatasetReference(project, dataset_id)
192-
table_ref = dataset_ref.table(table_id)
193-
table = client.get_table(table_ref) # API Request
194-
195-
# View table labels
196-
print("Table ID: {}".format(table_id))
197-
print("Labels:")
198-
if table.labels:
199-
for label, value in table.labels.items():
200-
print("\t{}: {}".format(label, value))
201-
else:
202-
print("\tTable has no labels defined.")
203-
# [END bigquery_get_table_labels]
204-
assert table.labels == labels
205-
206-
# TODO(Mattix23): After code sample is updated from cloud.google.com delete this
207-
208-
# [START bigquery_delete_label_table]
209-
# from google.cloud import bigquery
210-
# client = bigquery.Client()
211-
# project = client.project
212-
# dataset_ref = bigquery.DatasetReference(project, dataset_id)
213-
# table_ref = dataset_ref.table('my_table')
214-
# table = client.get_table(table_ref) # API request
215-
216-
# This example table starts with one label
217-
assert table.labels == {"color": "green"}
218-
# To delete a label from a table, set its value to None
219-
table.labels["color"] = None
220-
221-
table = client.update_table(table, ["labels"]) # API request
222-
223-
assert table.labels == {}
224-
# [END bigquery_delete_label_table]
225-
226-
227167
@pytest.mark.skip(
228168
reason=(
229169
"update_table() is flaky "

docs/usage/tables.rst

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ Create an empty table with the
5858
:start-after: [START bigquery_create_table]
5959
:end-before: [END bigquery_create_table]
6060

61+
Create a table using an external data source with the
62+
:func:`~google.cloud.bigquery.client.Client.create_table` method:
63+
64+
.. literalinclude:: ../samples/create_table_external_data_configuration.py
65+
:language: python
66+
:dedent: 4
67+
:start-after: [START bigquery_create_table_external_data_configuration]
68+
:end-before: [END bigquery_create_table_external_data_configuration]
69+
6170
Create a clustered table with the
6271
:func:`~google.cloud.bigquery.client.Client.create_table` method:
6372

google/cloud/bigquery/_http.py

-12
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,10 @@
1414

1515
"""Create / interact with Google BigQuery connections."""
1616

17-
import os
18-
import pkg_resources
19-
2017
from google.cloud import _http # type: ignore # pytype: disable=import-error
2118
from google.cloud.bigquery import __version__
2219

2320

24-
# TODO: Increase the minimum version of google-cloud-core to 1.6.0
25-
# and remove this logic. See:
26-
# https://github.com/googleapis/python-bigquery/issues/509
27-
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") == "true": # pragma: NO COVER
28-
release = pkg_resources.get_distribution("google-cloud-core").parsed_version
29-
if release < pkg_resources.parse_version("1.6.0"):
30-
raise ImportError("google-cloud-core >= 1.6.0 is required to use mTLS feature")
31-
32-
3321
class Connection(_http.JSONConnection):
3422
"""A connection to Google BigQuery via the JSON REST API.
3523

0 commit comments

Comments
 (0)