diff --git a/.kokoro/continuous/prerelease-deps-3.10.cfg b/.kokoro/continuous/prerelease-deps-3.10.cfg new file mode 100644 index 000000000..339980bdd --- /dev/null +++ b/.kokoro/continuous/prerelease-deps-3.10.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Only run this nox session. +env_vars: { + key: "NOX_SESSION" + value: "prerelease_deps-3.10" +} diff --git a/.kokoro/continuous/prerelease-deps-3.8.cfg b/.kokoro/continuous/prerelease-deps-3.8.cfg index 3595fb43f..fabe3e347 100644 --- a/.kokoro/continuous/prerelease-deps-3.8.cfg +++ b/.kokoro/continuous/prerelease-deps-3.8.cfg @@ -3,5 +3,5 @@ # Only run this nox session. env_vars: { key: "NOX_SESSION" - value: "prerelease_deps" + value: "prerelease_deps-3.8" } diff --git a/.kokoro/presubmit/prerelease-deps-3.10.cfg b/.kokoro/presubmit/prerelease-deps-3.10.cfg new file mode 100644 index 000000000..339980bdd --- /dev/null +++ b/.kokoro/presubmit/prerelease-deps-3.10.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Only run this nox session. +env_vars: { + key: "NOX_SESSION" + value: "prerelease_deps-3.10" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2db3cf3b2..48a150946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ [1]: https://pypi.org/project/google-cloud-bigquery/#history +### [2.34.1](https://github.com/googleapis/python-bigquery/compare/v2.34.0...v2.34.1) (2022-03-02) + + +### Dependencies + +* add "extra" for IPython, exclude bad IPython release ([#1151](https://github.com/googleapis/python-bigquery/issues/1151)) ([0fbe12d](https://github.com/googleapis/python-bigquery/commit/0fbe12d1ababa45aa774b026a93c0af9e8f343d9)) +* allow pyarrow 7.0 ([#1112](https://github.com/googleapis/python-bigquery/issues/1112)) ([57f8ea9](https://github.com/googleapis/python-bigquery/commit/57f8ea95e152dc238e7a4941f96c54be53f7eaf3)) + ## [2.34.0](https://github.com/googleapis/python-bigquery/compare/v2.33.0...v2.34.0) (2022-02-18) diff --git a/google/cloud/bigquery/version.py b/google/cloud/bigquery/version.py index 328c4cdc2..e1d00b4bf 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.34.0" +__version__ = "2.34.1" diff --git a/google/cloud/bigquery_v2/__init__.py b/google/cloud/bigquery_v2/__init__.py index f9957efa9..bb11be3b3 100644 --- a/google/cloud/bigquery_v2/__init__.py +++ b/google/cloud/bigquery_v2/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigquery_v2/types/__init__.py b/google/cloud/bigquery_v2/types/__init__.py index 83bbb3a54..c038bcd74 100644 --- a/google/cloud/bigquery_v2/types/__init__.py +++ b/google/cloud/bigquery_v2/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigquery_v2/types/encryption_config.py b/google/cloud/bigquery_v2/types/encryption_config.py index a95954a30..d300a417c 100644 --- a/google/cloud/bigquery_v2/types/encryption_config.py +++ b/google/cloud/bigquery_v2/types/encryption_config.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigquery_v2/types/model.py b/google/cloud/bigquery_v2/types/model.py index 84188e40c..f2c031715 100644 --- a/google/cloud/bigquery_v2/types/model.py +++ b/google/cloud/bigquery_v2/types/model.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigquery_v2/types/model_reference.py b/google/cloud/bigquery_v2/types/model_reference.py index 544377f61..a4aab59f7 100644 --- a/google/cloud/bigquery_v2/types/model_reference.py +++ b/google/cloud/bigquery_v2/types/model_reference.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigquery_v2/types/standard_sql.py b/google/cloud/bigquery_v2/types/standard_sql.py index e10619482..579c3b138 100644 --- a/google/cloud/bigquery_v2/types/standard_sql.py +++ b/google/cloud/bigquery_v2/types/standard_sql.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigquery_v2/types/table_reference.py b/google/cloud/bigquery_v2/types/table_reference.py index da206b4d7..aaab83e85 100644 --- a/google/cloud/bigquery_v2/types/table_reference.py +++ b/google/cloud/bigquery_v2/types/table_reference.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/noxfile.py b/noxfile.py index 505911861..6304747d1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -79,8 +79,6 @@ def default(session, install_extras=True): install_target = "." session.install("-e", install_target, "-c", constraints_path) - session.install("ipython", "-c", constraints_path) - # Run py.test against the unit tests. session.run( "py.test", @@ -119,7 +117,6 @@ def unit_noextras(session): def mypy(session): """Run type checks with mypy.""" session.install("-e", ".[all]") - session.install("ipython") session.install(MYPY_VERSION) # Just install the dependencies' type info directly, since "mypy --install-types" @@ -138,7 +135,6 @@ def pytype(session): # 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) session.run("pytype") @@ -180,7 +176,6 @@ def system(session): else: extras = "[all]" session.install("-e", f".{extras}", "-c", constraints_path) - session.install("ipython", "-c", constraints_path) # Run py.test against the system tests. session.run("py.test", "--quiet", os.path.join("tests", "system"), *session.posargs) @@ -355,7 +350,7 @@ def blacken(session): def docs(session): """Build the docs.""" - session.install("ipython", "recommonmark", "sphinx==4.0.1", "sphinx_rtd_theme") + session.install("recommonmark", "sphinx==4.0.1", "sphinx_rtd_theme") session.install("google-cloud-storage") session.install("-e", ".[all]") diff --git a/samples/geography/requirements-test.txt b/samples/geography/requirements-test.txt index 5d836a5c5..4bd417eba 100644 --- a/samples/geography/requirements-test.txt +++ b/samples/geography/requirements-test.txt @@ -1,2 +1,2 @@ -pytest==6.2.5 +pytest==7.0.1 mock==4.0.3 diff --git a/samples/geography/requirements.txt b/samples/geography/requirements.txt index b07ba50bf..710f4de0a 100644 --- a/samples/geography/requirements.txt +++ b/samples/geography/requirements.txt @@ -1,45 +1,46 @@ attrs==21.4.0 certifi==2021.10.8 cffi==1.15.0 -charset-normalizer==2.0.10 -click==8.0.3 +charset-normalizer==2.0.12 +click==8.0.4 click-plugins==1.1.1 cligj==0.7.2 dataclasses==0.8; python_version < '3.7' -Fiona==1.8.20 +Fiona==1.8.21 geojson==2.5.0 geopandas==0.9.0; python_version < '3.7' geopandas==0.10.2; python_version >= '3.7' -google-api-core==2.4.0 -google-auth==2.3.3 -google-cloud-bigquery==2.31.0 -google-cloud-bigquery-storage==2.10.1 -google-cloud-core==2.2.1 +google-api-core==2.5.0 +google-auth==2.6.0 +google-cloud-bigquery==2.34.0 +google-cloud-bigquery-storage==2.12.0 +google-cloud-core==2.2.2 google-crc32c==1.3.0 -google-resumable-media==2.1.0 -googleapis-common-protos==1.54.0 -grpcio==1.43.0 +google-resumable-media==2.3.0 +googleapis-common-protos==1.55.0 +grpcio==1.44.0 idna==3.3 -libcst==0.4.0 +libcst==0.4.1 munch==2.5.0 mypy-extensions==0.4.3 packaging==21.3 pandas==1.1.5; python_version < '3.7' -pandas==1.3.5; python_version >= '3.7' -proto-plus==1.19.8 -protobuf==3.19.3 -pyarrow==6.0.1 +pandas==1.3.5; python_version == '3.7' +pandas==1.4.1; python_version >= '3.8' +proto-plus==1.20.3 +protobuf==3.19.4 +pyarrow==7.0.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycparser==2.21 -pyparsing==3.0.6 +pyparsing==3.0.7 python-dateutil==2.8.2 pytz==2021.3 PyYAML==6.0 requests==2.27.1 rsa==4.8 -Shapely==1.8.0 +Shapely==1.8.1.post1 six==1.16.0 -typing-extensions==4.0.1 +typing-extensions==4.1.1 typing-inspect==0.7.1 urllib3==1.26.8 diff --git a/samples/magics/requirements-test.txt b/samples/magics/requirements-test.txt index 5b73f1fd5..bafc3de2a 100644 --- a/samples/magics/requirements-test.txt +++ b/samples/magics/requirements-test.txt @@ -1,3 +1,3 @@ google-cloud-testutils==1.3.1 -pytest==6.2.5 +pytest==7.0.1 mock==4.0.3 diff --git a/samples/magics/requirements.txt b/samples/magics/requirements.txt index b47dcbc4f..0ea9c5710 100644 --- a/samples/magics/requirements.txt +++ b/samples/magics/requirements.txt @@ -1,12 +1,14 @@ -google-cloud-bigquery-storage==2.10.1 -google-auth-oauthlib==0.4.6 -grpcio==1.43.0 -ipython==7.16.1; python_version < '3.7' -ipython==7.29.0; python_version == '3.7' -ipython==8.0.0; python_version >= '3.8' -matplotlib==3.3.4; python_version < '3.7' +google-cloud-bigquery-storage==2.12.0 +google-auth-oauthlib==0.5.0 +grpcio==1.44.0 +ipython==7.16.3; python_version < '3.7' +ipython==7.31.1; python_version == '3.7' +ipython==8.0.1; python_version == '3.8' +ipython==8.1.0; python_version >= '3.9' +matplotlib==3.5.1; python_version < '3.7' matplotlib==3.5.1; python_version >= '3.7' pandas==1.1.5; python_version < '3.7' -pandas==1.3.5; python_version >= '3.7' -pyarrow==6.0.1 +pandas==1.3.5; python_version == '3.7' +pandas==1.4.1; python_version >= '3.8' +pyarrow==7.0.0 pytz==2021.3 diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 5b73f1fd5..bafc3de2a 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1,3 +1,3 @@ google-cloud-testutils==1.3.1 -pytest==6.2.5 +pytest==7.0.1 mock==4.0.3 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index b47dcbc4f..0ea9c5710 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,12 +1,14 @@ -google-cloud-bigquery-storage==2.10.1 -google-auth-oauthlib==0.4.6 -grpcio==1.43.0 -ipython==7.16.1; python_version < '3.7' -ipython==7.29.0; python_version == '3.7' -ipython==8.0.0; python_version >= '3.8' -matplotlib==3.3.4; python_version < '3.7' +google-cloud-bigquery-storage==2.12.0 +google-auth-oauthlib==0.5.0 +grpcio==1.44.0 +ipython==7.16.3; python_version < '3.7' +ipython==7.31.1; python_version == '3.7' +ipython==8.0.1; python_version == '3.8' +ipython==8.1.0; python_version >= '3.9' +matplotlib==3.5.1; python_version < '3.7' matplotlib==3.5.1; python_version >= '3.7' pandas==1.1.5; python_version < '3.7' -pandas==1.3.5; python_version >= '3.7' -pyarrow==6.0.1 +pandas==1.3.5; python_version == '3.7' +pandas==1.4.1; python_version >= '3.8' +pyarrow==7.0.0 pytz==2021.3 diff --git a/samples/snippets/user_credentials.py b/samples/snippets/user_credentials.py index 6089d9fd9..e8dccf143 100644 --- a/samples/snippets/user_credentials.py +++ b/samples/snippets/user_credentials.py @@ -23,26 +23,22 @@ import argparse -def main(project, launch_browser=True): +def main(project): # [START bigquery_auth_user_flow] from google_auth_oauthlib import flow - # TODO: Uncomment the line below to set the `launch_browser` variable. - # launch_browser = True - # - # The `launch_browser` boolean variable indicates if a local server is used - # as the callback URL in the auth flow. A value of `True` is recommended, - # but a local server does not work if accessing the application remotely, - # such as over SSH or from a remote Jupyter notebook. - + # A local server is used as the callback URL in the auth flow. appflow = flow.InstalledAppFlow.from_client_secrets_file( "client_secrets.json", scopes=["https://www.googleapis.com/auth/bigquery"] ) - if launch_browser: - appflow.run_local_server() - else: - appflow.run_console() + # This launches a local server to be used as the callback URL in the desktop + # app auth flow. If you are accessing the application remotely, such as over + # SSH or a remote Jupyter notebook, this flow will not work. Use the + # `gcloud auth application-default login --no-browser` command or workload + # identity federation to get authentication tokens, instead. + # + appflow.run_local_server() credentials = appflow.credentials # [END bigquery_auth_user_flow] diff --git a/samples/snippets/user_credentials_test.py b/samples/snippets/user_credentials_test.py index 829502d25..66c1bddb7 100644 --- a/samples/snippets/user_credentials_test.py +++ b/samples/snippets/user_credentials_test.py @@ -35,7 +35,7 @@ def mock_flow(): def test_auth_query_console(mock_flow, capsys): - main(PROJECT, launch_browser=False) + main(PROJECT) out, _ = capsys.readouterr() # Fun fact: William P. Wood was the 1st director of the US Secret Service. assert "William" in out diff --git a/setup.py b/setup.py index 5c0b80f7c..6a28d21c3 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 5 - Production/Stable" -pyarrow_dep = ["pyarrow >= 3.0.0, < 7.0dev"] +pyarrow_dep = ["pyarrow >=3.0.0, <8.0dev"] dependencies = [ "grpcio >= 1.38.1, < 2.0dev", # https://github.com/googleapis/python-bigquery/issues/695 # NOTE: Maintainers, please do not require google-api-core>=2.x.x @@ -61,6 +61,7 @@ "geopandas": ["geopandas>=0.9.0, <1.0dev", "Shapely>=1.6.0, <2.0dev"], "pandas": ["pandas>=0.24.2"] + pyarrow_dep, "bignumeric_type": pyarrow_dep, + "ipython": ["ipython>=7.0.1,!=8.1.0"], "tqdm": ["tqdm >= 4.7.4, <5.0.0dev"], "opentelemetry": [ "opentelemetry-api >= 1.1.0", diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index f967077bc..7f52e441d 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -11,6 +11,7 @@ google-cloud-bigquery-storage==2.0.0 google-cloud-core==1.4.1 google-resumable-media==0.6.0 grpcio==1.38.1 +ipython==7.0.1 opentelemetry-api==1.1.0 opentelemetry-instrumentation==0.20b0 opentelemetry-sdk==1.1.0 diff --git a/tests/__init__.py b/tests/__init__.py index 4de65971c..e8e1c3845 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 4de65971c..e8e1c3845 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/__init__.py b/tests/unit/gapic/__init__.py index 4de65971c..e8e1c3845 100644 --- a/tests/unit/gapic/__init__.py +++ b/tests/unit/gapic/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/line_arg_parser/test_lexer.py b/tests/unit/line_arg_parser/test_lexer.py index 22fa96f22..3624ed0f3 100644 --- a/tests/unit/line_arg_parser/test_lexer.py +++ b/tests/unit/line_arg_parser/test_lexer.py @@ -14,6 +14,8 @@ import pytest +IPython = pytest.importorskip("IPython") + @pytest.fixture(scope="session") def lexer_class(): diff --git a/tests/unit/line_arg_parser/test_parser.py b/tests/unit/line_arg_parser/test_parser.py index 3edff88e9..3f9e9ff41 100644 --- a/tests/unit/line_arg_parser/test_parser.py +++ b/tests/unit/line_arg_parser/test_parser.py @@ -14,6 +14,8 @@ import pytest +IPython = pytest.importorskip("IPython") + @pytest.fixture(scope="session") def parser_class(): diff --git a/tests/unit/line_arg_parser/test_visitors.py b/tests/unit/line_arg_parser/test_visitors.py index 51d4f837a..288ef5f71 100644 --- a/tests/unit/line_arg_parser/test_visitors.py +++ b/tests/unit/line_arg_parser/test_visitors.py @@ -14,6 +14,8 @@ import pytest +IPython = pytest.importorskip("IPython") + @pytest.fixture def base_visitor(): diff --git a/tests/unit/test_magics.py b/tests/unit/test_magics.py index 2801768f8..a4214f32f 100644 --- a/tests/unit/test_magics.py +++ b/tests/unit/test_magics.py @@ -17,31 +17,30 @@ from concurrent import futures import warnings -import mock -import pytest - -try: - import pandas -except ImportError: # pragma: NO COVER - pandas = None - from google.api_core import exceptions import google.auth.credentials +import mock +import pytest +from tests.unit.helpers import make_connection +from test_utils.imports import maybe_fail_import from google.cloud import bigquery from google.cloud.bigquery import job from google.cloud.bigquery import table -from google.cloud.bigquery.magics import magics from google.cloud.bigquery.retry import DEFAULT_TIMEOUT -from tests.unit.helpers import make_connection -from test_utils.imports import maybe_fail_import +try: + from google.cloud.bigquery.magics import magics +except ImportError: + magics = None + +bigquery_storage = pytest.importorskip("google.cloud.bigquery_storage") IPython = pytest.importorskip("IPython") -io = pytest.importorskip("IPython.utils.io") -tools = pytest.importorskip("IPython.testing.tools") interactiveshell = pytest.importorskip("IPython.terminal.interactiveshell") -bigquery_storage = pytest.importorskip("google.cloud.bigquery_storage") +tools = pytest.importorskip("IPython.testing.tools") +io = pytest.importorskip("IPython.utils.io") +pandas = pytest.importorskip("pandas") @pytest.fixture(scope="session")