diff --git a/ci/requirements-2.7.txt b/ci/requirements-2.7.txt index 951c8798bef15..d2a3a8ea3cf03 100644 --- a/ci/requirements-2.7.txt +++ b/ci/requirements-2.7.txt @@ -22,4 +22,4 @@ html5lib=1.0b2 beautiful-soup=4.2.1 httplib2=0.8 python-gflags=2.0 -google-api-python-client=1.2 +google-api-python-client=1.2.0 diff --git a/pandas/io/gbq.py b/pandas/io/gbq.py index 06ad8827a5642..fb19ba0ee766e 100644 --- a/pandas/io/gbq.py +++ b/pandas/io/gbq.py @@ -1,4 +1,5 @@ from datetime import datetime +import re import json import logging import sys @@ -25,8 +26,10 @@ def _check_google_client_version(): raise ImportError('Could not import pkg_resources (setuptools).') _GOOGLE_API_CLIENT_VERSION = pkg_resources.get_distribution('google-api-python-client').version + _GOOGLE_API_CLIENT_VERSION = re.sub( + r'(\.0+)*$', '', _GOOGLE_API_CLIENT_VERSION) - if LooseVersion(_GOOGLE_API_CLIENT_VERSION) < '1.2.0': + if LooseVersion(_GOOGLE_API_CLIENT_VERSION) < '1.2': raise ImportError("pandas requires google-api-python-client >= 1.2.0 for Google " "BigQuery support, current version " + _GOOGLE_API_CLIENT_VERSION) @@ -121,7 +124,7 @@ def get_service(self, credentials): try: from apiclient.discovery import build - + except ImportError: raise ImportError('Could not import Google API Client.')