From 28485871dfff01ed18cd6ee56f36a7e373c6733d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Apr 2021 16:20:25 +0200 Subject: [PATCH 1/8] chore(deps): update dependency google-cloud-bigquery to v2.15.0 (#639) --- samples/geography/requirements.txt | 2 +- samples/snippets/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/geography/requirements.txt b/samples/geography/requirements.txt index f46b141fd..324ece4ef 100644 --- a/samples/geography/requirements.txt +++ b/samples/geography/requirements.txt @@ -1,4 +1,4 @@ geojson==2.5.0 -google-cloud-bigquery==2.14.0 +google-cloud-bigquery==2.15.0 google-cloud-bigquery-storage==2.4.0 Shapely==1.7.1 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index f7b5cebe9..077896cb3 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,4 +1,4 @@ -google-cloud-bigquery==2.14.0 +google-cloud-bigquery==2.15.0 google-cloud-bigquery-storage==2.4.0 google-auth-oauthlib==0.4.4 grpcio==1.37.0 From 471a76117b9f6353e343a2f493aee181e19c2f79 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Apr 2021 16:45:10 +0200 Subject: [PATCH 2/8] chore(deps): update dependency pyarrow to v4 (#641) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 077896cb3..7e04b06b5 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -8,5 +8,5 @@ matplotlib==3.3.4; python_version < '3.7' matplotlib==3.4.1; python_version >= '3.7' pandas==1.1.5; python_version < '3.7' pandas==1.2.0; python_version >= '3.7' -pyarrow==3.0.0 +pyarrow==4.0.0 pytz==2021.1 From 6a48e80bc7d347f381b181f4cf81fef105d0ad0d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Apr 2021 16:45:32 +0200 Subject: [PATCH 3/8] chore(deps): update dependency grpcio to v1.37.1 (#640) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 7e04b06b5..04883477a 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,7 +1,7 @@ google-cloud-bigquery==2.15.0 google-cloud-bigquery-storage==2.4.0 google-auth-oauthlib==0.4.4 -grpcio==1.37.0 +grpcio==1.37.1 ipython==7.16.1; python_version < '3.7' ipython==7.17.0; python_version >= '3.7' matplotlib==3.3.4; python_version < '3.7' From be3c49a72f0e04de4055f5ca7a99f821c2c8f240 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 4 May 2021 19:32:02 +0200 Subject: [PATCH 4/8] chore(deps): update dependency pytest to v6.2.4 (#647) --- samples/geography/requirements-test.txt | 2 +- samples/snippets/requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/geography/requirements-test.txt b/samples/geography/requirements-test.txt index 299d90b65..b0cf76724 100644 --- a/samples/geography/requirements-test.txt +++ b/samples/geography/requirements-test.txt @@ -1,2 +1,2 @@ -pytest==6.2.3 +pytest==6.2.4 mock==4.0.3 diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 299d90b65..b0cf76724 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1,2 +1,2 @@ -pytest==6.2.3 +pytest==6.2.4 mock==4.0.3 From 6cc6876eb0e5bf49fdc047256a945dcf1b289576 Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Wed, 5 May 2021 14:41:46 +0200 Subject: [PATCH 5/8] feat: add with_name() to ScalarQueryParameterType (#644) * feat: add with_name() to ScalarQueryParameterType * Clarify unsetting a name, add extra test --- google/cloud/bigquery/query.py | 15 +++++++++++++++ tests/unit/test_query.py | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/google/cloud/bigquery/query.py b/google/cloud/bigquery/query.py index 3751eb124..d1e9a45a5 100644 --- a/google/cloud/bigquery/query.py +++ b/google/cloud/bigquery/query.py @@ -16,6 +16,7 @@ from collections import OrderedDict import copy +from typing import Union from google.cloud.bigquery.table import _parse_schema_resource from google.cloud.bigquery._helpers import _rows_from_json @@ -119,6 +120,20 @@ def to_api_repr(self): # attributes in the API representation when needed. Here we omit them. return {"type": self._type} + def with_name(self, new_name: Union[str, None]): + """Return a copy of the instance with ``name`` set to ``new_name``. + + Args: + name (Union[str, None]): + The new name of the query parameter type. If ``None``, the existing + name is cleared. + + Returns: + google.cloud.bigquery.query.ScalarQueryParameterType: + A new instance with updated name. + """ + return type(self)(self._type, name=new_name, description=self.description) + def __repr__(self): name = f", name={self.name!r}" if self.name is not None else "" description = ( diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py index c8be2911f..90fc30b20 100644 --- a/tests/unit/test_query.py +++ b/tests/unit/test_query.py @@ -98,6 +98,26 @@ def test_repr_all_optional_attrs(self): "ScalarQueryParameterType('BYTES', name='foo', description='this is foo')", ) + def test_with_name_returns_copy_w_changed_name(self): + param_type = self._make_one("BOOLEAN", name=None, description="Some checkbox.") + modified_type = param_type.with_name("allow_emails") + + self.assertIsNot(modified_type, param_type) # Result is a copy. + self.assertEqual(modified_type.name, "allow_emails") + + # The rest of the The rest of the fields should have been preserved. + self.assertEqual(modified_type._type, param_type._type) + self.assertEqual(modified_type.description, param_type.description) + + def test_with_name_clearing_the_value(self): + param_type = self._make_one( + "BOOLEAN", name="allow_emails", description="Some checkbox." + ) + modified_type = param_type.with_name(None) + + self.assertIsNone(modified_type.name) + self.assertEqual(param_type.name, "allow_emails") # original unchanged + class Test_ArrayQueryParameterType(unittest.TestCase): @staticmethod From 9e1d3869c2024fe7a8af57ff59838d904ca5db03 Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Wed, 5 May 2021 15:49:10 +0200 Subject: [PATCH 6/8] deps: expand supported pyarrow versions to v4 (#643) * deps: expand supported pyarrow versions to v4 * Expand *all* pyarrow pins. * Constrain pyarrow to v4.0.0+ in Python 3.9 tests --- setup.py | 6 +++--- testing/constraints-3.9.txt | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 607ffb63f..6a6202ef9 100644 --- a/setup.py +++ b/setup.py @@ -47,10 +47,10 @@ # grpc.Channel.close() method isn't added until 1.32.0. # https://github.com/grpc/grpc/pull/15254 "grpcio >= 1.32.0, < 2.0dev", - "pyarrow >= 1.0.0, < 4.0dev", + "pyarrow >= 1.0.0, < 5.0dev", ], - "pandas": ["pandas>=0.23.0", "pyarrow >= 1.0.0, < 4.0dev"], - "bignumeric_type": ["pyarrow >= 3.0.0, < 4.0dev"], + "pandas": ["pandas>=0.23.0", "pyarrow >= 1.0.0, < 5.0dev"], + "bignumeric_type": ["pyarrow >= 3.0.0, < 5.0dev"], "tqdm": ["tqdm >= 4.7.4, <5.0.0dev"], "opentelemetry": [ "opentelemetry-api >= 0.11b0", diff --git a/testing/constraints-3.9.txt b/testing/constraints-3.9.txt index e69de29bb..39dc6250e 100644 --- a/testing/constraints-3.9.txt +++ b/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# This constraints file is used to make sure that the latest dependency versions +# we claim to support in setup.py are indeed installed in test sessions in the most +# recent Python version supported (3.9 at the time of writing - 2021-05-05). +# +# NOTE: Not comprehensive yet, will eventually be maintained semi-automatically by +# the renovate bot. +pyarrow>=4.0.0 From a6a4eeac8f832cf9e24b0a4391b9848587fb6d29 Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Wed, 5 May 2021 17:17:19 +0200 Subject: [PATCH 7/8] chore: use file paths for --cov args in noxfile (#648) --- noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 7ba081660..654bbd093 100644 --- a/noxfile.py +++ b/noxfile.py @@ -77,8 +77,8 @@ def default(session, install_extras=True): session.run( "py.test", "--quiet", - "--cov=google.cloud.bigquery", - "--cov=tests.unit", + "--cov=google/cloud/bigquery", + "--cov=tests/unit", "--cov-append", "--cov-config=.coveragerc", "--cov-report=", From 144ceeaac0167f774b86c39a042a2de2b8b4d356 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 6 May 2021 11:36:10 +0200 Subject: [PATCH 8/8] chore: release 2.16.0 (#649) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ google/cloud/bigquery/version.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a222a710..15d594c1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://pypi.org/project/google-cloud-bigquery/#history +## [2.16.0](https://www.github.com/googleapis/python-bigquery/compare/v2.15.0...v2.16.0) (2021-05-05) + + +### Features + +* add with_name() to ScalarQueryParameterType ([#644](https://www.github.com/googleapis/python-bigquery/issues/644)) ([6cc6876](https://www.github.com/googleapis/python-bigquery/commit/6cc6876eb0e5bf49fdc047256a945dcf1b289576)) + + +### Dependencies + +* expand supported pyarrow versions to v4 ([#643](https://www.github.com/googleapis/python-bigquery/issues/643)) ([9e1d386](https://www.github.com/googleapis/python-bigquery/commit/9e1d3869c2024fe7a8af57ff59838d904ca5db03)) + ## [2.15.0](https://www.github.com/googleapis/python-bigquery/compare/v2.14.0...v2.15.0) (2021-04-29) diff --git a/google/cloud/bigquery/version.py b/google/cloud/bigquery/version.py index a8381fff6..a93d72c2b 100644 --- a/google/cloud/bigquery/version.py +++ b/google/cloud/bigquery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2.15.0" +__version__ = "2.16.0"