We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Integration test with pyarrow nightly builds?
I'm not sure how difficult it would be to add, but it might be useful to regularly test the library against pyarrow nightly build's to catch regressions before they make their way into releases.




--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `noxfile.py`
Content:
```
1 # Copyright 2016 Google LLC
2 #
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 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 from __future__ import absolute_import
16 
17 import pathlib
18 import os
19 import shutil
20 
21 import nox
22 
23 
24 BLACK_VERSION = "black==19.10b0"
25 BLACK_PATHS = ("docs", "google", "samples", "tests", "noxfile.py", "setup.py")
26 CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
27 
28 # 'docfx' is excluded since it only needs to run in 'docs-presubmit'
29 nox.options.sessions = [
30     "unit",
31     "system",
32     "snippets",
33     "cover",
34     "lint",
35     "lint_setup_py",
36     "blacken",
37     "docs",
38 ]
39 
40 
41 def default(session):
42     """Default unit test session.
43 
44     This is intended to be run **without** an interpreter set, so
45     that the current ``python`` (on the ``PATH``) or the version of
46     Python corresponding to the ``nox`` binary the ``PATH`` can
47     run the tests.
48     """
49     constraints_path = str(
50         CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
51     )
52 
53     # Install all test dependencies, then install local packages in-place.
54     session.install(
55         "mock",
56         "pytest",
57         "google-cloud-testutils",
58         "pytest-cov",
59         "freezegun",
60         "-c",
61         constraints_path,
62     )
63 
64     session.install("-e", ".[all]", "-c", constraints_path)
65 
66     session.install("ipython", "-c", constraints_path)
67 
68     # Run py.test against the unit tests.
69     session.run(
70         "py.test",
71         "--quiet",
72         "--cov=google.cloud.bigquery",
73         "--cov=tests.unit",
74         "--cov-append",
75         "--cov-config=.coveragerc",
76         "--cov-report=",
77         "--cov-fail-under=0",
78         os.path.join("tests", "unit"),
79         *session.posargs,
80     )
81 
82 
83 @nox.session(python=["3.6", "3.7", "3.8"])
84 def unit(session):
85     """Run the unit test suite."""
86     default(session)
87 
88 
89 @nox.session(python=["3.8"])
90 def system(session):
91     """Run the system test suite."""
92 
93     constraints_path = str(
94         CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
95     )
96 
97     # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
98     if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
99         session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
100 
101     # Sanity check: Only run system tests if the environment variable is set.
102     if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
103         session.skip("Credentials must be set via environment variable.")
104 
105     # Use pre-release gRPC for system tests.
106     session.install("--pre", "grpcio", "-c", constraints_path)
107 
108     # Install all test dependencies, then install local packages in place.
109     session.install(
110         "mock", "pytest", "psutil", "google-cloud-testutils", "-c", constraints_path
111     )
112     session.install("google-cloud-storage", "-c", constraints_path)
113 
114     session.install("-e", ".[all]", "-c", constraints_path)
115     session.install("ipython", "-c", constraints_path)
116 
117     # Run py.test against the system tests.
118     session.run(
119         "py.test", "--quiet", os.path.join("tests", "system.py"), *session.posargs
120     )
121 
122 
123 @nox.session(python=["3.8"])
124 def snippets(session):
125     """Run the snippets test suite."""
126 
127     # Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.
128     if os.environ.get("RUN_SNIPPETS_TESTS", "true") == "false":
129         session.skip("RUN_SNIPPETS_TESTS is set to false, skipping")
130 
131     # Sanity check: Only run snippets tests if the environment variable is set.
132     if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
133         session.skip("Credentials must be set via environment variable.")
134 
135     constraints_path = str(
136         CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
137     )
138 
139     # Install all test dependencies, then install local packages in place.
140     session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path)
141     session.install("google-cloud-storage", "-c", constraints_path)
142     session.install("grpcio", "-c", constraints_path)
143 
144     session.install("-e", ".[all]", "-c", constraints_path)
145 
146     # Run py.test against the snippets tests.
147     # Skip tests in samples/snippets, as those are run in a different session
148     # using the nox config from that directory.
149     session.run("py.test", os.path.join("docs", "snippets.py"), *session.posargs)
150     session.run(
151         "py.test",
152         "samples",
153         "--ignore=samples/snippets",
154         "--ignore=samples/geography",
155         *session.posargs,
156     )
157 
158 
159 @nox.session(python="3.8")
160 def cover(session):
161     """Run the final coverage report.
162 
163     This outputs the coverage report aggregating coverage from the unit
164     test runs (not system test runs), and then erases coverage data.
165     """
166     session.install("coverage", "pytest-cov")
167     session.run("coverage", "report", "--show-missing", "--fail-under=100")
168     session.run("coverage", "erase")
169 
170 
171 @nox.session(python="3.8")
172 def lint(session):
173     """Run linters.
174 
175     Returns a failure if the linters find linting errors or sufficiently
176     serious code quality issues.
177     """
178 
179     session.install("flake8", BLACK_VERSION)
180     session.install("-e", ".")
181     session.run("flake8", os.path.join("google", "cloud", "bigquery"))
182     session.run("flake8", "tests")
183     session.run("flake8", os.path.join("docs", "samples"))
184     session.run("flake8", os.path.join("docs", "snippets.py"))
185     session.run("black", "--check", *BLACK_PATHS)
186 
187 
188 @nox.session(python="3.8")
189 def lint_setup_py(session):
190     """Verify that setup.py is valid (including RST check)."""
191 
192     session.install("docutils", "Pygments")
193     session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
194 
195 
196 @nox.session(python="3.6")
197 def blacken(session):
198     """Run black.
199     Format code to uniform standard.
200 
201     This currently uses Python 3.6 due to the automated Kokoro run of synthtool.
202     That run uses an image that doesn't have 3.6 installed. Before updating this
203     check the state of the `gcp_ubuntu_config` we use for that Kokoro run.
204     """
205     session.install(BLACK_VERSION)
206     session.run("black", *BLACK_PATHS)
207 
208 
209 @nox.session(python="3.8")
210 def docs(session):
211     """Build the docs."""
212 
213     session.install("ipython", "recommonmark", "sphinx", "sphinx_rtd_theme")
214     session.install("google-cloud-storage")
215     session.install("-e", ".[all]")
216 
217     shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
218     session.run(
219         "sphinx-build",
220         "-W",  # warnings as errors
221         "-T",  # show full traceback on exception
222         "-N",  # no colors
223         "-b",
224         "html",
225         "-d",
226         os.path.join("docs", "_build", "doctrees", ""),
227         os.path.join("docs", ""),
228         os.path.join("docs", "_build", "html", ""),
229     )
230 
231 
232 @nox.session(python="3.8")
233 def docfx(session):
234     """Build the docfx yaml files for this library."""
235 
236     session.install("-e", ".")
237     session.install("sphinx", "alabaster", "recommonmark", "sphinx-docfx-yaml")
238 
239     shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
240     session.run(
241         "sphinx-build",
242         "-T",  # show full traceback on exception
243         "-N",  # no colors
244         "-D",
245         (
246             "extensions=sphinx.ext.autodoc,"
247             "sphinx.ext.autosummary,"
248             "docfx_yaml.extension,"
249             "sphinx.ext.intersphinx,"
250             "sphinx.ext.coverage,"
251             "sphinx.ext.napoleon,"
252             "sphinx.ext.todo,"
253             "sphinx.ext.viewcode,"
254             "recommonmark"
255         ),
256         "-b",
257         "html",
258         "-d",
259         os.path.join("docs", "_build", "doctrees", ""),
260         os.path.join("docs", ""),
261         os.path.join("docs", "_build", "html", ""),
262     )
263
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -168,6 +168,38 @@
     session.run("coverage", "erase")
 
 
+@nox.session(python="3.8")
+def prerelease_deps(session):
+    """Run all tests with prerelease versions of dependencies installed.
+
+    https://github.com/googleapis/python-bigquery/issues/95
+    """
+    # PyArrow prerelease packages are published to an alternative PyPI host.
+    # https://arrow.apache.org/docs/python/install.html#installing-nightly-packages
+    session.install(
+        "--extra-index-url", "https://pypi.fury.io/arrow-nightlies/", "--pre", "pyarrow"
+    )
+    session.install("--pre", "grpcio", "pandas")
+    session.install(
+        "mock",
+        "pytest",
+        "google-cloud-testutils",
+        "pytest-cov",
+        "freezegun",
+        "IPython",
+    )
+    session.install("-e", ".[all]")
+
+    # Print out prerelease package versions.
+    session.run("python", "-c", "import grpc; print(grpc.__version__)")
+    session.run("python", "-c", "import pandas; print(pandas.__version__)")
+    session.run("python", "-c", "import pyarrow; print(pyarrow.__version__)")
+
+    # Run all tests, except a few samples tests which require extra dependencies.
+    session.run("py.test", "tests")
+    session.run("py.test", "samples/tests")
+
+
 @nox.session(python="3.8")
 def lint(session):
     """Run linters.

{"golden_diff": "diff --git a/noxfile.py b/noxfile.py\n--- a/noxfile.py\n+++ b/noxfile.py\n@@ -168,6 +168,38 @@\n     session.run(\"coverage\", \"erase\")\n \n \n+@nox.session(python=\"3.8\")\n+def prerelease_deps(session):\n+    \"\"\"Run all tests with prerelease versions of dependencies installed.\n+\n+    https://github.com/googleapis/python-bigquery/issues/95\n+    \"\"\"\n+    # PyArrow prerelease packages are published to an alternative PyPI host.\n+    # https://arrow.apache.org/docs/python/install.html#installing-nightly-packages\n+    session.install(\n+        \"--extra-index-url\", \"https://pypi.fury.io/arrow-nightlies/\", \"--pre\", \"pyarrow\"\n+    )\n+    session.install(\"--pre\", \"grpcio\", \"pandas\")\n+    session.install(\n+        \"mock\",\n+        \"pytest\",\n+        \"google-cloud-testutils\",\n+        \"pytest-cov\",\n+        \"freezegun\",\n+        \"IPython\",\n+    )\n+    session.install(\"-e\", \".[all]\")\n+\n+    # Print out prerelease package versions.\n+    session.run(\"python\", \"-c\", \"import grpc; print(grpc.__version__)\")\n+    session.run(\"python\", \"-c\", \"import pandas; print(pandas.__version__)\")\n+    session.run(\"python\", \"-c\", \"import pyarrow; print(pyarrow.__version__)\")\n+\n+    # Run all tests, except a few samples tests which require extra dependencies.\n+    session.run(\"py.test\", \"tests\")\n+    session.run(\"py.test\", \"samples/tests\")\n+\n+\n @nox.session(python=\"3.8\")\n def lint(session):\n     \"\"\"Run linters.\n", "issue": "Integration test with pyarrow nightly builds?\nI'm not sure how difficult it would be to add, but it might be useful to regularly test the library against pyarrow nightly build's to catch regressions before they make their way into releases.\r\n\r\n\r\n\n", "before_files": [{"content": "# Copyright 2016 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\n\nimport pathlib\nimport os\nimport shutil\n\nimport nox\n\n\nBLACK_VERSION = \"black==19.10b0\"\nBLACK_PATHS = (\"docs\", \"google\", \"samples\", \"tests\", \"noxfile.py\", \"setup.py\")\nCURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()\n\n# 'docfx' is excluded since it only needs to run in 'docs-presubmit'\nnox.options.sessions = [\n    \"unit\",\n    \"system\",\n    \"snippets\",\n    \"cover\",\n    \"lint\",\n    \"lint_setup_py\",\n    \"blacken\",\n    \"docs\",\n]\n\n\ndef default(session):\n    \"\"\"Default unit test session.\n\n    This is intended to be run **without** an interpreter set, so\n    that the current ``python`` (on the ``PATH``) or the version of\n    Python corresponding to the ``nox`` binary the ``PATH`` can\n    run the tests.\n    \"\"\"\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in-place.\n    session.install(\n        \"mock\",\n        \"pytest\",\n        \"google-cloud-testutils\",\n        \"pytest-cov\",\n        \"freezegun\",\n        \"-c\",\n        constraints_path,\n    )\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the unit tests.\n    session.run(\n        \"py.test\",\n        \"--quiet\",\n        \"--cov=google.cloud.bigquery\",\n        \"--cov=tests.unit\",\n        \"--cov-append\",\n        \"--cov-config=.coveragerc\",\n        \"--cov-report=\",\n        \"--cov-fail-under=0\",\n        os.path.join(\"tests\", \"unit\"),\n        *session.posargs,\n    )\n\n\n@nox.session(python=[\"3.6\", \"3.7\", \"3.8\"])\ndef unit(session):\n    \"\"\"Run the unit test suite.\"\"\"\n    default(session)\n\n\n@nox.session(python=[\"3.8\"])\ndef system(session):\n    \"\"\"Run the system test suite.\"\"\"\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SYSTEM_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SYSTEM_TESTS is set to false, skipping\")\n\n    # Sanity check: Only run system tests if the environment variable is set.\n    if not os.environ.get(\"GOOGLE_APPLICATION_CREDENTIALS\", \"\"):\n        session.skip(\"Credentials must be set via environment variable.\")\n\n    # Use pre-release gRPC for system tests.\n    session.install(\"--pre\", \"grpcio\", \"-c\", constraints_path)\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\n        \"mock\", \"pytest\", \"psutil\", \"google-cloud-testutils\", \"-c\", constraints_path\n    )\n    session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the system tests.\n    session.run(\n        \"py.test\", \"--quiet\", os.path.join(\"tests\", \"system.py\"), *session.posargs\n    )\n\n\n@nox.session(python=[\"3.8\"])\ndef snippets(session):\n    \"\"\"Run the snippets test suite.\"\"\"\n\n    # Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SNIPPETS_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SNIPPETS_TESTS is set to false, skipping\")\n\n    # Sanity check: Only run snippets tests if the environment variable is set.\n    if not os.environ.get(\"GOOGLE_APPLICATION_CREDENTIALS\", \"\"):\n        session.skip(\"Credentials must be set via environment variable.\")\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\"mock\", \"pytest\", \"google-cloud-testutils\", \"-c\", constraints_path)\n    session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n    session.install(\"grpcio\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n\n    # Run py.test against the snippets tests.\n    # Skip tests in samples/snippets, as those are run in a different session\n    # using the nox config from that directory.\n    session.run(\"py.test\", os.path.join(\"docs\", \"snippets.py\"), *session.posargs)\n    session.run(\n        \"py.test\",\n        \"samples\",\n        \"--ignore=samples/snippets\",\n        \"--ignore=samples/geography\",\n        *session.posargs,\n    )\n\n\n@nox.session(python=\"3.8\")\ndef cover(session):\n    \"\"\"Run the final coverage report.\n\n    This outputs the coverage report aggregating coverage from the unit\n    test runs (not system test runs), and then erases coverage data.\n    \"\"\"\n    session.install(\"coverage\", \"pytest-cov\")\n    session.run(\"coverage\", \"report\", \"--show-missing\", \"--fail-under=100\")\n    session.run(\"coverage\", \"erase\")\n\n\n@nox.session(python=\"3.8\")\ndef lint(session):\n    \"\"\"Run linters.\n\n    Returns a failure if the linters find linting errors or sufficiently\n    serious code quality issues.\n    \"\"\"\n\n    session.install(\"flake8\", BLACK_VERSION)\n    session.install(\"-e\", \".\")\n    session.run(\"flake8\", os.path.join(\"google\", \"cloud\", \"bigquery\"))\n    session.run(\"flake8\", \"tests\")\n    session.run(\"flake8\", os.path.join(\"docs\", \"samples\"))\n    session.run(\"flake8\", os.path.join(\"docs\", \"snippets.py\"))\n    session.run(\"black\", \"--check\", *BLACK_PATHS)\n\n\n@nox.session(python=\"3.8\")\ndef lint_setup_py(session):\n    \"\"\"Verify that setup.py is valid (including RST check).\"\"\"\n\n    session.install(\"docutils\", \"Pygments\")\n    session.run(\"python\", \"setup.py\", \"check\", \"--restructuredtext\", \"--strict\")\n\n\n@nox.session(python=\"3.6\")\ndef blacken(session):\n    \"\"\"Run black.\n    Format code to uniform standard.\n\n    This currently uses Python 3.6 due to the automated Kokoro run of synthtool.\n    That run uses an image that doesn't have 3.6 installed. Before updating this\n    check the state of the `gcp_ubuntu_config` we use for that Kokoro run.\n    \"\"\"\n    session.install(BLACK_VERSION)\n    session.run(\"black\", *BLACK_PATHS)\n\n\n@nox.session(python=\"3.8\")\ndef docs(session):\n    \"\"\"Build the docs.\"\"\"\n\n    session.install(\"ipython\", \"recommonmark\", \"sphinx\", \"sphinx_rtd_theme\")\n    session.install(\"google-cloud-storage\")\n    session.install(\"-e\", \".[all]\")\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-W\",  # warnings as errors\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n\n\n@nox.session(python=\"3.8\")\ndef docfx(session):\n    \"\"\"Build the docfx yaml files for this library.\"\"\"\n\n    session.install(\"-e\", \".\")\n    session.install(\"sphinx\", \"alabaster\", \"recommonmark\", \"sphinx-docfx-yaml\")\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-D\",\n        (\n            \"extensions=sphinx.ext.autodoc,\"\n            \"sphinx.ext.autosummary,\"\n            \"docfx_yaml.extension,\"\n            \"sphinx.ext.intersphinx,\"\n            \"sphinx.ext.coverage,\"\n            \"sphinx.ext.napoleon,\"\n            \"sphinx.ext.todo,\"\n            \"sphinx.ext.viewcode,\"\n            \"recommonmark\"\n        ),\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n", "path": "noxfile.py"}], "after_files": [{"content": "# Copyright 2016 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\n\nimport pathlib\nimport os\nimport shutil\n\nimport nox\n\n\nBLACK_VERSION = \"black==19.10b0\"\nBLACK_PATHS = (\"docs\", \"google\", \"samples\", \"tests\", \"noxfile.py\", \"setup.py\")\nCURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()\n\n# 'docfx' is excluded since it only needs to run in 'docs-presubmit'\nnox.options.sessions = [\n    \"unit\",\n    \"system\",\n    \"snippets\",\n    \"cover\",\n    \"lint\",\n    \"lint_setup_py\",\n    \"blacken\",\n    \"docs\",\n]\n\n\ndef default(session):\n    \"\"\"Default unit test session.\n\n    This is intended to be run **without** an interpreter set, so\n    that the current ``python`` (on the ``PATH``) or the version of\n    Python corresponding to the ``nox`` binary the ``PATH`` can\n    run the tests.\n    \"\"\"\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in-place.\n    session.install(\n        \"mock\",\n        \"pytest\",\n        \"google-cloud-testutils\",\n        \"pytest-cov\",\n        \"freezegun\",\n        \"-c\",\n        constraints_path,\n    )\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the unit tests.\n    session.run(\n        \"py.test\",\n        \"--quiet\",\n        \"--cov=google.cloud.bigquery\",\n        \"--cov=tests.unit\",\n        \"--cov-append\",\n        \"--cov-config=.coveragerc\",\n        \"--cov-report=\",\n        \"--cov-fail-under=0\",\n        os.path.join(\"tests\", \"unit\"),\n        *session.posargs,\n    )\n\n\n@nox.session(python=[\"3.6\", \"3.7\", \"3.8\"])\ndef unit(session):\n    \"\"\"Run the unit test suite.\"\"\"\n    default(session)\n\n\n@nox.session(python=[\"3.8\"])\ndef system(session):\n    \"\"\"Run the system test suite.\"\"\"\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SYSTEM_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SYSTEM_TESTS is set to false, skipping\")\n\n    # Sanity check: Only run system tests if the environment variable is set.\n    if not os.environ.get(\"GOOGLE_APPLICATION_CREDENTIALS\", \"\"):\n        session.skip(\"Credentials must be set via environment variable.\")\n\n    # Use pre-release gRPC for system tests.\n    session.install(\"--pre\", \"grpcio\", \"-c\", constraints_path)\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\n        \"mock\", \"pytest\", \"psutil\", \"google-cloud-testutils\", \"-c\", constraints_path\n    )\n    session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the system tests.\n    session.run(\n        \"py.test\", \"--quiet\", os.path.join(\"tests\", \"system.py\"), *session.posargs\n    )\n\n\n@nox.session(python=[\"3.8\"])\ndef snippets(session):\n    \"\"\"Run the snippets test suite.\"\"\"\n\n    # Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SNIPPETS_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SNIPPETS_TESTS is set to false, skipping\")\n\n    # Sanity check: Only run snippets tests if the environment variable is set.\n    if not os.environ.get(\"GOOGLE_APPLICATION_CREDENTIALS\", \"\"):\n        session.skip(\"Credentials must be set via environment variable.\")\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\"mock\", \"pytest\", \"google-cloud-testutils\", \"-c\", constraints_path)\n    session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n    session.install(\"grpcio\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n\n    # Run py.test against the snippets tests.\n    # Skip tests in samples/snippets, as those are run in a different session\n    # using the nox config from that directory.\n    session.run(\"py.test\", os.path.join(\"docs\", \"snippets.py\"), *session.posargs)\n    session.run(\n        \"py.test\",\n        \"samples\",\n        \"--ignore=samples/snippets\",\n        \"--ignore=samples/geography\",\n        *session.posargs,\n    )\n\n\n@nox.session(python=\"3.8\")\ndef cover(session):\n    \"\"\"Run the final coverage report.\n\n    This outputs the coverage report aggregating coverage from the unit\n    test runs (not system test runs), and then erases coverage data.\n    \"\"\"\n    session.install(\"coverage\", \"pytest-cov\")\n    session.run(\"coverage\", \"report\", \"--show-missing\", \"--fail-under=100\")\n    session.run(\"coverage\", \"erase\")\n\n\n@nox.session(python=\"3.8\")\ndef prerelease_deps(session):\n    \"\"\"Run all tests with prerelease versions of dependencies installed.\n\n    https://github.com/googleapis/python-bigquery/issues/95\n    \"\"\"\n    # PyArrow prerelease packages are published to an alternative PyPI host.\n    # https://arrow.apache.org/docs/python/install.html#installing-nightly-packages\n    session.install(\n        \"--extra-index-url\", \"https://pypi.fury.io/arrow-nightlies/\", \"--pre\", \"pyarrow\"\n    )\n    session.install(\"--pre\", \"grpcio\", \"pandas\")\n    session.install(\n        \"mock\",\n        \"pytest\",\n        \"google-cloud-testutils\",\n        \"pytest-cov\",\n        \"freezegun\",\n        \"IPython\",\n    )\n    session.install(\"-e\", \".[all]\")\n\n    # Print out prerelease package versions.\n    session.run(\"python\", \"-c\", \"import grpc; print(grpc.__version__)\")\n    session.run(\"python\", \"-c\", \"import pandas; print(pandas.__version__)\")\n    session.run(\"python\", \"-c\", \"import pyarrow; print(pyarrow.__version__)\")\n\n    # Run all tests, except a few samples tests which require extra dependencies.\n    session.run(\"py.test\", \"tests\")\n    session.run(\"py.test\", \"samples/tests\")\n\n\n@nox.session(python=\"3.8\")\ndef lint(session):\n    \"\"\"Run linters.\n\n    Returns a failure if the linters find linting errors or sufficiently\n    serious code quality issues.\n    \"\"\"\n\n    session.install(\"flake8\", BLACK_VERSION)\n    session.install(\"-e\", \".\")\n    session.run(\"flake8\", os.path.join(\"google\", \"cloud\", \"bigquery\"))\n    session.run(\"flake8\", \"tests\")\n    session.run(\"flake8\", os.path.join(\"docs\", \"samples\"))\n    session.run(\"flake8\", os.path.join(\"docs\", \"snippets.py\"))\n    session.run(\"black\", \"--check\", *BLACK_PATHS)\n\n\n@nox.session(python=\"3.8\")\ndef lint_setup_py(session):\n    \"\"\"Verify that setup.py is valid (including RST check).\"\"\"\n\n    session.install(\"docutils\", \"Pygments\")\n    session.run(\"python\", \"setup.py\", \"check\", \"--restructuredtext\", \"--strict\")\n\n\n@nox.session(python=\"3.6\")\ndef blacken(session):\n    \"\"\"Run black.\n    Format code to uniform standard.\n\n    This currently uses Python 3.6 due to the automated Kokoro run of synthtool.\n    That run uses an image that doesn't have 3.6 installed. Before updating this\n    check the state of the `gcp_ubuntu_config` we use for that Kokoro run.\n    \"\"\"\n    session.install(BLACK_VERSION)\n    session.run(\"black\", *BLACK_PATHS)\n\n\n@nox.session(python=\"3.8\")\ndef docs(session):\n    \"\"\"Build the docs.\"\"\"\n\n    session.install(\"ipython\", \"recommonmark\", \"sphinx\", \"sphinx_rtd_theme\")\n    session.install(\"google-cloud-storage\")\n    session.install(\"-e\", \".[all]\")\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-W\",  # warnings as errors\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n\n\n@nox.session(python=\"3.8\")\ndef docfx(session):\n    \"\"\"Build the docfx yaml files for this library.\"\"\"\n\n    session.install(\"-e\", \".\")\n    session.install(\"sphinx\", \"alabaster\", \"recommonmark\", \"sphinx-docfx-yaml\")\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-D\",\n        (\n            \"extensions=sphinx.ext.autodoc,\"\n            \"sphinx.ext.autosummary,\"\n            \"docfx_yaml.extension,\"\n            \"sphinx.ext.intersphinx,\"\n            \"sphinx.ext.coverage,\"\n            \"sphinx.ext.napoleon,\"\n            \"sphinx.ext.todo,\"\n            \"sphinx.ext.viewcode,\"\n            \"recommonmark\"\n        ),\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n", "path": "noxfile.py"}]}