google/budou

WARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth

jccmga opened this issue · 3 comments

When upgrading google-api-python-client and oauth2client, there is this warning from the GCP cloud:

"WARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth"

It would be great to be able to specify if the build call in this line should use the cache or no:

service = googleapiclient.discovery.build(

I was thinking something like this:

class NLAPISegmenter(Segmenter):
...
def __init__(self, cache_filename, credentials_path, use_entity, use_cache, cache_discovery):
  ...
  self._authenticate(cache_discovery)
...

def _authenticate(self, cache_discovery):
...
service = googleapiclient.discovery.build(
        'language', 'v1beta2', http=authed_http, cache_discovery=cache_discovery)

Hi Juan,
Thank you for flagging this issue! Your suggested change looks good to me. Do you want to make a PR for this change?

Hi Shuhei,

Sure! Here it is: #96

Closing this issue since the PR is merged.