8000 Use updated uri for gcs batch reqs by jackdingilian · Pull Request #2998 · spotify/luigi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use updated uri for gcs batch reqs #2998

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

Merged

Conversation

jackdingilian
Copy link
Contributor
@jackdingilian jackdingilian commented Sep 17, 2020

Description

The default batch_uri used by BatchHttpRequest is deprecated: https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html

This update uses the gcs specific batch uri in gcs_client and bumps google-api-python-client's lower bound to make sure we use a compatible version. Currently batch removals using the client are calling the deprecated uri (https://github.com/googleapis/google-api-python-client/blob/master/googleapiclient/http.py#L1175).

Have you tested this? If so, how?

I have run the gcs_client test which covers batch removal and I also tested end-to-end with an actual luigi job we use this in.

@@ -231,7 +234,7 @@ def remove(self, path, recursive=True):
raise InvalidDeleteException(
'Path {} is a directory. Must use recursive delete'.format(path))

req = http.BatchHttpRequest()
req = http.BatchHttpRequest(batch_uri=GCS_BATCH_URI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So google api client doesn't set this as default? It's a bit surprising.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default still goes to the global batch uri (https://www.googleapis.com/batch) - now there's a different batch endpoint for each api (but BatchHttpRequest is still generic to request type) so you need to set it to the uri for whatever api you are using

@honnix honnix merged commit 3556ec2 into spotify:master Sep 18, 2020
@jackdingilian jackdingilian deleted the use-correct-uri-for-gcs-batch-reqs branch September 21, 2020 20:49
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

Successfully merging this pull request may close these issues.

2 participants
0