Repository: googleapis/python-bigquery

Issue:
chore: use paths for --cov arguments in noxfile
https://github.com/googleapis/python-bigquery/blob/6a48e80bc7d347f381b181f4cf81fef105d0ad0d/noxfile.py#L80-L81

To pull https://github.com/googleapis/synthtool/pull/859 from templates.

Discussion:

Patch:
diff --git a/google/cloud/bigquery/query.py b/google/cloud/bigquery/query.py
index 3751eb12..d1e9a45a 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 @@ class ScalarQueryParameterType(_AbstractQueryParameterType):
         # 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/noxfile.py b/noxfile.py
index 7ba08166..654bbd09 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=",
diff --git a/setup.py b/setup.py
index 607ffb63..6a6202ef 100644
--- a/setup.py
+++ b/setup.py
@@ -47,10 +47,10 @@ extras = {
         # 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",


Test patch:
diff --git a/testing/constraints-3.9.txt b/testing/constraints-3.9.txt
index e69de29b..39dc6250 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
diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py
index c8be2911..90fc30b2 100644
--- a/tests/unit/test_query.py
+++ b/tests/unit/test_query.py
@@ -98,6 +98,26 @@ class Test_ScalarQueryParameterType(unittest.TestCase):
             "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