Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dependency on protobuf. #7668

Merged
merged 1 commit into from
Apr 5, 2019

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Apr 5, 2019

This is required for the generated classes from the Models API.

Closes #7667

This is required for the generated classed from the Models API.
@tswast tswast requested a review from a team April 5, 2019 14:55
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 5, 2019
@tswast
Copy link
Contributor Author

tswast commented Apr 5, 2019

Tested locally with minimal virtualenv.

$ pip freeze
atomicwrites==1.3.0
attrs==19.1.0
cachetools==3.1.0
certifi==2019.3.9
chardet==3.0.4
google-api-core==1.8.2
google-auth==1.6.3
-e git+git@github.com:tsw...#egg=google_cloud_bigquery&subdirectory=bigquery
google-cloud-core==0.29.1
google-resumable-media==0.3.2
googleapis-common-protos==1.5.9
idna==2.8
mock==2.0.0
more-itertools==7.0.0
pbr==5.1.3
pluggy==0.9.0
protobuf==3.6.0
py==1.8.0
pyasn1==0.4.5
pyasn1-modules==0.2.4
pytest==4.4.0
pytz==2018.9
requests==2.21.0
rsa==4.0
six==1.12.0
urllib3==1.24.1



$ pytest tests/unit                                            
==================================== test session starts ====================================
platform darwin -- Python 3.6.4, pytest-4.4.0, py-1.8.0, pluggy-0.9.0
rootdir: /Users/swast/src/google-cloud-python/bigquery
collected 980 items                                                                         

tests/unit/test__helpers.py ......................................................... [  5%]
..................................................................                    [ 12%]
tests/unit/test__http.py ...                                                          [ 12%]
tests/unit/test_client.py ........................................................... [ 18%]
...................................................................................ss [ 27%]
s...                                                                                  [ 27%]
tests/unit/test_dataset.py .......................................................... [ 33%]
...........                                                                           [ 35%]
tests/unit/test_dbapi__helpers.py .....                                               [ 35%]
tests/unit/test_dbapi_connection.py ......                                            [ 36%]
tests/unit/test_dbapi_cursor.py ...................                                   [ 38%]
tests/unit/test_dbapi_types.py ...                                                    [ 38%]
tests/unit/test_external_config.py ...........                                        [ 39%]
tests/unit/test_job.py .............................................................. [ 45%]
..................................................................................... [ 54%]
..................................................................................... [ 63%]
........................sssss.................                                        [ 67%]
tests/unit/test_magics.py sssssssssssssssssss                                         [ 69%]
tests/unit/test_query.py ............................................................ [ 75%]
....................................                                                  [ 79%]
tests/unit/test_retry.py ..........                                                   [ 80%]
tests/unit/test_schema.py ...................................                         [ 84%]
tests/unit/test_table.py ............................................................ [ 90%]
..............................s....ss.sssssssssss....................s                [ 97%]
tests/unit/model/test_model.py ...............                                        [ 98%]
tests/unit/model/test_model_reference.py ..........                                   [100%]

========================== 938 passed, 42 skipped in 7.97 seconds ======================

Tested that it fails with older protobuf.

$ pip install protobuf==3.5.2
Collecting protobuf==3.5.2
  Downloading https://files.pythonhosted.org/packages/c4/7b/fbf783beb1c9d1766c64a9f4b4b80fd3f8732470697d01b3eb824d188486/protobuf-3.5.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 436kB/s 
Requirement already satisfied: six>=1.9 in /Users/swast/.pyenv/versions/3.6.4/envs/google-cloud-bigquery-minimal/lib/python3.6/site-packages (from protobuf==3.5.2)
Requirement already satisfied: setuptools in /Users/swast/.pyenv/versions/3.6.4/envs/google-cloud-bigquery-minimal/lib/python3.6/site-packages (from protobuf==3.5.2)
Installing collected packages: protobuf
  Found existing installation: protobuf 3.6.0
    Uninstalling protobuf-3.6.0:
      Successfully uninstalled protobuf-3.6.0
Successfully installed protobuf-3.5.2



$ pytest tests/unit          
==================================== test session starts ====================================
platform darwin -- Python 3.6.4, pytest-4.4.0, py-1.8.0, pluggy-0.9.0
rootdir: /Users/swast/src/google-cloud-python/bigquery
collected 302 items / 9 errors / 293 selected                                               

========================================== ERRORS ===========================================
________________________ ERROR collecting tests/unit/test_client.py _________________________
tests/unit/test_client.py:41: in <module>
    from google.cloud.bigquery.dataset import DatasetReference
google/cloud/bigquery/__init__.py:35: in <module>
    from google.cloud.bigquery.client import Client
google/cloud/bigquery/client.py:45: in <module>
    from google.cloud.bigquery.dataset import Dataset
google/cloud/bigquery/dataset.py:24: in <module>
    from google.cloud.bigquery.model import ModelReference
google/cloud/bigquery/model.py:27: in <module>
    from google.cloud.bigquery_v2 import types
google/cloud/bigquery_v2/__init__.py:23: in <module>
    from google.cloud.bigquery_v2 import types
google/cloud/bigquery_v2/types.py:22: in <module>
    from google.cloud.bigquery_v2.proto import model_pb2
google/cloud/bigquery_v2/proto/model_pb2.py:17: in <module>
    from google.cloud.bigquery_v2.proto import (
google/cloud/bigquery_v2/proto/model_reference_pb2.py:17: in <module>
    from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
../../../.pyenv/versions/3.6.4/envs/google-cloud-bigquery-minimal/lib/python3.6/site-packages/google/api/annotations_pb2.py:15: in <module>
    from google.api import http_pb2 as google_dot_api_dot_http__pb2
../../../.pyenv/versions/3.6.4/envs/google-cloud-bigquery-minimal/lib/python3.6/site-packages/google/api/http_pb2.py:22: in <module>
    serialized_pb=_b('\n\x15google/api/http.proto\x12\ngoogle.api\"T\n\x04Http\x12#\n\x05rules\x18\x01 \x03(\x0b\x32\x14.google.api.HttpRule\x12\'\n\x1f\x66ully_decode_reserved_expansion\x18\x02 \x01(\x08\"\x81\x02\n\x08HttpRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x15\n\rresponse_body\x18\x0c \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern\"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x02\x04GAPIb\x06proto3')
E   TypeError: __new__() got an unexpected keyword argument 'serialized_options'
________________________ ERROR collecting tests/unit/test_dataset.py ________________________
...

@tswast tswast merged commit a290091 into googleapis:master Apr 5, 2019
@tswast tswast deleted the issue7667-protobuf-deps branch April 5, 2019 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants