-
Notifications
You must be signed in to change notification settings - Fork 71
#484 Add GSClient timeout support #485
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
#484 Add GSClient timeout support #485
Conversation
|
Thanks @Mchristos! Code looks reasonable, but I was wondering if there are other kwargs that are either shared or that we should accept as |
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (44.4%) is below the target coverage (80.0%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## 484-live-tests #485 +/- ##
================================================
- Coverage 94.4% 92.0% -2.5%
================================================
Files 23 23
Lines 1776 1805 +29
================================================
- Hits 1678 1661 -17
- Misses 98 144 +46
|
Hi @pjbull, thanks a lot for reviewing my code! I'll include the 3 function signatures that we use below, and the common kwargs between them. I think only The other option is that we put the onus on the user to specify a valid GCP kwarg, but then of course we may have the possible issue of mismatching kwargs between these functions (possibly even in a future gcsfs release). Function signatures: Common kwargs between these are: Of these, the client kwarg is redundant, and the kwargs around generation and metageneration matches are not relevant, since these are are related to copying between blobs, and I don't think we require support for that. That leaves
@pjbull let me know if you agree and I will include the |
|
@Mchristos Sorry for the delay, getting this PR moving again. I think your plan sounds good for now. Do you still have time to add retry and we can merge this? Could you also open an issue for supporting kwargs to these functions generically? That way we can track if there are other kwargs of interest and if we need a more flexible future solution with multiple kwargs. |
|
@pjbull Apologies for the delay from my end too. Please see the latest change, which adds optional Retry configuration to GSClient. Let me know if you're happy with it |
|
@Mchristos Looks like a mypy issue. You can use https://cloudpathlib.drivendata.org/stable/contributing/#linting-and-formatting |
|
@pjbull Thanks, I had some issues getting |
@pjbull I've added an issue for supporting generic kwargs: #503 |
|
Merging into 484-live-tests to run live tests. |
* #484 Add GSClient timeout support (#485) * add timeout support * no implicit optional * add optional retry * black * try this * type annotations --------- Co-authored-by: Chris Marais <[email protected]> * add changelog and tests --------- Co-authored-by: chris <[email protected]> Co-authored-by: Chris Marais <[email protected]>

Adds GSClient option to include a timeout in seconds. When using google.cloud.storage, it's possible to manually increase the timeout from the default of 60 seconds, but with cloudpathlib it's not possible to tweak this. This makes, for example, uploading larger files with slow internet connection impossible to achieve using cloudpathlib
Closes #484
Contributor checklist:
CONTRIBUTING.mdCloses #issueappears in the PR summary (e.g.,Closes #123).HISTORY.mdwith the issue that is addressed and the PR you are submitting. If the top section is not `## UNRELEASED``, then you need to add a new section to the top of the document for your change.Usage: