From e24d47e72a3fdb8b6fe3d387abc31f79c5a32bc0 Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Fri, 7 May 2021 16:55:55 +0200 Subject: [PATCH 1/5] chore: avoid pytype error caused by attrs==21.1.0 (#656) --- noxfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/noxfile.py b/noxfile.py index 654bbd093..dc77be3b7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -103,6 +103,10 @@ def unit_noextras(session): @nox.session(python=DEFAULT_PYTHON_VERSION) def pytype(session): """Run type checks.""" + # An indirect dependecy attrs==21.1.0 breaks the check, and installing a less + # recent version avoids the error until a possibly better fix is found. + # https://github.com/googleapis/python-bigquery/issues/655 + session.install("attrs==20.3.0") session.install("-e", ".[all]") session.install("ipython") session.install(PYTYPE_VERSION) From 240d1d2ba125b83c4277b2f2cd6724d66cd95bb9 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Fri, 7 May 2021 16:14:02 -0600 Subject: [PATCH 2/5] chore: use 3.8 for blacken session (#653) The Autosynth build now has 3.8: https://github.com/googleapis/synthtool/commit/fd33d7df9ecfc79cc6dbe552b497a4fb36f2e635#diff-f80f936e0eac73417c05535c764a44906afd70a37096ea3c58934a9f6f1e7fcd Should fix unexpected style in #651 --- noxfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/noxfile.py b/noxfile.py index dc77be3b7..a52025635 100644 --- a/noxfile.py +++ b/noxfile.py @@ -257,15 +257,12 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") -@nox.session(python="3.6") +@nox.session(python=DEFAULT_PYTHON_VERSION) def blacken(session): """Run black. Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ + session.install(BLACK_VERSION) session.run("black", *BLACK_PATHS) From 615d139be15bbbaea1517eb4a5d75b93055c6663 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 9 May 2021 04:05:30 -0400 Subject: [PATCH 3/5] chore: add library type to .repo-metadata.json (#658) --- .repo-metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.repo-metadata.json b/.repo-metadata.json index f50dbbeb2..f132056d5 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -6,6 +6,7 @@ "issue_tracker": "https://issuetracker.google.com/savedsearches/559654", "release_level": "ga", "language": "python", + "library_type": "GAPIC_COMBO", "repo": "googleapis/python-bigquery", "distribution_name": "google-cloud-bigquery", "api_id": "bigquery.googleapis.com", From aeadc8c2d614bb9f0883ec901fca48930f3aaf19 Mon Sep 17 00:00:00 2001 From: Jim Fulton Date: Wed, 12 May 2021 04:22:20 -0600 Subject: [PATCH 4/5] fix: executemany rowcount only reflected the last execution (#660) --- google/cloud/bigquery/dbapi/cursor.py | 4 ++++ tests/unit/test_dbapi_cursor.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/google/cloud/bigquery/dbapi/cursor.py b/google/cloud/bigquery/dbapi/cursor.py index f74781df9..c8fc49378 100644 --- a/google/cloud/bigquery/dbapi/cursor.py +++ b/google/cloud/bigquery/dbapi/cursor.py @@ -218,6 +218,7 @@ def executemany(self, operation, seq_of_parameters): Sequence of many sets of parameter values. """ if seq_of_parameters: + rowcount = 0 # There's no reason to format the line more than once, as # the operation only barely depends on the parameters. So # we just use the first set of parameters. If there are @@ -230,6 +231,9 @@ def executemany(self, operation, seq_of_parameters): self._execute( formatted_operation, parameters, None, None, parameter_types ) + rowcount += self.rowcount + + self.rowcount = rowcount def _try_fetch(self, size=None): """Try to start fetching data, if not yet started. diff --git a/tests/unit/test_dbapi_cursor.py b/tests/unit/test_dbapi_cursor.py index 5afe269ef..55e453254 100644 --- a/tests/unit/test_dbapi_cursor.py +++ b/tests/unit/test_dbapi_cursor.py @@ -612,7 +612,7 @@ def test_executemany_w_dml(self): (("test",), ("anothertest",)), ) self.assertIsNone(cursor.description) - self.assertEqual(cursor.rowcount, 12) + self.assertEqual(cursor.rowcount, 24) # 24 because 2 * 12 because cumulatve. def test_executemany_empty(self): from google.cloud.bigquery.dbapi import connect From c6ba15593f4d7541793e45295d9e531fd214094a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 09:17:21 +0200 Subject: [PATCH 5/5] chore: release 2.16.1 (#662) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ google/cloud/bigquery/version.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15d594c1b..ef184dffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-bigquery/#history +### [2.16.1](https://www.github.com/googleapis/python-bigquery/compare/v2.16.0...v2.16.1) (2021-05-12) + + +### Bug Fixes + +* executemany rowcount only reflected the last execution ([#660](https://www.github.com/googleapis/python-bigquery/issues/660)) ([aeadc8c](https://www.github.com/googleapis/python-bigquery/commit/aeadc8c2d614bb9f0883ec901fca48930f3aaf19)) + ## [2.16.0](https://www.github.com/googleapis/python-bigquery/compare/v2.15.0...v2.16.0) (2021-05-05) diff --git a/google/cloud/bigquery/version.py b/google/cloud/bigquery/version.py index a93d72c2b..61e0c0a83 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.16.0" +__version__ = "2.16.1"