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

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

Closed
juancamilo1 opened this issue Aug 1, 2019 · 3 comments

Comments

@juancamilo1
Copy link
Contributor

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)
@tushuhei
Copy link
Member

tushuhei commented Aug 7, 2019

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?

@juancamilo1
Copy link
Contributor Author

juancamilo1 commented Aug 8, 2019

Hi Shuhei,

Sure! Here it is: #96

@tushuhei
Copy link
Member

Closing this issue since the PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants