From 8ed8760cddee5922d935951a5a20c8ce9e38b308 Mon Sep 17 00:00:00 2001 From: Francesco Della Vedova Date: Wed, 22 Jul 2015 21:14:00 +0200 Subject: [PATCH 1/2] BUG: #10652 google-api-python-client minimum version check --- pandas/io/gbq.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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.') From ed1a8d0aa97b72f4de708ede6d6adc4eb39edc8f Mon Sep 17 00:00:00 2001 From: Francesco Della Vedova Date: Fri, 24 Jul 2015 14:58:57 +0200 Subject: [PATCH 2/2] changed google-api-python-client version from 1.2 to 1.2.0 --- ci/requirements-2.7.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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