Allow a requests.Session object to be passed into Client - #164
Conversation
This will allow the client to re-use an existing session and not have re-establish the connection over subsequent calls.
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
|
Looks good, although I think a couple of things are off:
Basically the session handling should all be internal. |
|
I'll move session out of class level. The latter is a bit more confusing. It feels like the interface to instantiating the If you don't like it, I can certainly alter it. |
|
Awesome, thanks for addressing the feedback - one last thing: I don't think the test is useful, it's not actually making any assertions, so we can probably get rid of it for now. A useful test would be to somehow verify that multiple method calls on the client reused the same connection under the hood in requests, but I'm not certain how feasible that is. |
|
I'm not certain how to verify the sessions across instances in a unit test either. The test was useful to verify the code worked but you are right, there are no assertions and it should go. Unit test has been removed. Anything else I can do? |
Nope, all looks good. Thanks a lot for this and for working through the feedback! |
This will allow the client to re-use an existing session and not have re-establish the connection over subsequent calls.