Skip to content

Commit cbcb4b8

Browse files
authored
chore: Prepare for 2.0 release (#278)
* Remove BQ Storage v1beta1 compatibility code * Adjust code to new BQ Storage 2.0 * Remove Python 2/3 compatibility code * Bump test coverage to 100% * Update supported Python versions in README * Add UPGRADING guide. * Regenerate bigquery_v2 code with microgenerator * Adjust hand-written unit tests to regened BQ v2 * Adjust samples to BQ v2 regenerated code * Adjust system tests to regenerated BQ v2 * Skip failing generated unit test The assertion seems to fail for a banal reason, i.e. an extra newline in the string representation. * Delete Kokoro config for Python 2.7 * Fix docs build * Undelete failing test, but mark as skipped * Fix namespace name in docstrings and comments * Define minimum dependency versions for Python 3.6 * Exclude autogenerated docs from docs index * Exclude generated services from the library There are currently no public API endpoints for the ModelServiceClient, thus there is no point in generating that code in the first place. * Bump minumum proto-plus version to 1.10.0 The old pin (1.4.0) does not work, tests detected some problem. * Include generated types in the docs and rebuild * Ignore skipped test in coverage check * Explain moved enums in UPGRADING guide
1 parent fbbe0cb commit cbcb4b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1974
-1682
lines changed

.kokoro/presubmit/presubmit.cfg

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
2-
3-
# Disable system tests.
4-
env_vars: {
5-
key: "RUN_SYSTEM_TESTS"
6-
value: "false"
7-
}
1+
# Format: //devtools/kokoro/config/proto/build.proto

.kokoro/presubmit/system-2.7.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

.kokoro/samples/python3.6/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.6"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py36"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-bigquery/.kokoro/test-samples.sh"

.kokoro/samples/python3.7/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.7"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py37"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-bigquery/.kokoro/test-samples.sh"

.kokoro/samples/python3.8/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.8"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py38"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-bigquery/.kokoro/test-samples.sh"

CONTRIBUTING.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,6 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
8080

8181
.. nox: https://pypi.org/project/nox/
8282
83-
Note on Editable Installs / Develop Mode
84-
========================================
85-
86-
- As mentioned previously, using ``setuptools`` in `develop mode`_
87-
or a ``pip`` `editable install`_ is not possible with this
88-
library. This is because this library uses `namespace packages`_.
89-
For context see `Issue #2316`_ and the relevant `PyPA issue`_.
90-
91-
Since ``editable`` / ``develop`` mode can't be used, packages
92-
need to be installed directly. Hence your changes to the source
93-
tree don't get incorporated into the **already installed**
94-
package.
95-
96-
.. _namespace packages: https://www.python.org/dev/peps/pep-0420/
97-
.. _Issue #2316: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2316
98-
.. _PyPA issue: https://github.com/pypa/packaging-problems/issues/12
99-
.. _develop mode: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
100-
.. _editable install: https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
101-
10283
*****************************************
10384
I'm getting weird errors... Can you help?
10485
*****************************************

README.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,14 @@ dependencies.
5252

5353
Supported Python Versions
5454
^^^^^^^^^^^^^^^^^^^^^^^^^
55-
Python >= 3.5
55+
Python >= 3.6
5656

57-
Deprecated Python Versions
58-
^^^^^^^^^^^^^^^^^^^^^^^^^^
59-
Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
57+
Unsupported Python Versions
58+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
59+
Python == 2.7, Python == 3.5.
60+
61+
The last version of this library compatible with Python 2.7 and 3.5 is
62+
`google-cloud-bigquery==1.28.0`.
6063

6164

6265
Mac/Linux

UPGRADING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!--
2+
Copyright 2020 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
https://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
-->
13+
14+
15+
# 2.0.0 Migration Guide
16+
17+
The 2.0 release of the `google-cloud-bigquery` client drops support for Python
18+
versions below 3.6. The client surface itself has not changed, but the 1.x series
19+
will not be receiving any more feature updates or bug fixes. You are thus
20+
encouraged to upgrade to the 2.x series.
21+
22+
If you experience issues or have questions, please file an
23+
[issue](https://github.com/googleapis/python-bigquery/issues).
24+
25+
26+
## Supported Python Versions
27+
28+
> **WARNING**: Breaking change
29+
30+
The 2.0.0 release requires Python 3.6+.
31+
32+
33+
## Supported BigQuery Storage Clients
34+
35+
The 2.0.0 release requires BigQuery Storage `>= 2.0.0`, which dropped support
36+
for `v1beta1` and `v1beta2` versions of the BigQuery Storage API. If you want to
37+
use a BigQuery Storage client, it must be the one supporting the `v1` API version.
38+
39+
40+
## Changed GAPIC Enums Path
41+
42+
> **WARNING**: Breaking change
43+
44+
Generated GAPIC enum types have been moved under `types`. Import paths need to be
45+
adjusted.
46+
47+
**Before:**
48+
```py
49+
from google.cloud.bigquery_v2.gapic import enums
50+
51+
distance_type = enums.Model.DistanceType.COSINE
52+
```
53+
54+
**After:**
55+
```py
56+
from google.cloud.bigquery_v2 import types
57+
58+
distance_type = types.Model.DistanceType.COSINE
59+
```

docs/UPGRADING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../UPGRADING.md

docs/bigquery_v2/services.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Services for Google Cloud Bigquery v2 API
2+
=========================================
3+
4+
.. automodule:: google.cloud.bigquery_v2.services.model_service
5+
:members:
6+
:inherited-members:

0 commit comments

Comments
 (0)