Support custom requests session in presto connections#106
Conversation
| service ('http' or 'https'). (default='http') | ||
| source (str): The source of this query (by default "omniduct <version>"). | ||
| If manually specified, result will be: "<source> / omniduct <version>". | ||
| requests_session (requests.Session): an optional ``requests.Session`` object for advanced usage. |
There was a problem hiding this comment.
nit: single backticks here on requests.Session
| self.source = source | ||
| self.__presto = None | ||
| self.connection_fields += ('catalog', 'schema') | ||
| self.requests_session = requests_session |
There was a problem hiding this comment.
likely we should have the be private (ie. start with an underscore)
danfrankj
left a comment
There was a problem hiding this comment.
Hey @gthomas-slack - thanks for this and for contributing to omniduct! A couple nits but nothing significant. I'll let @matthewwardrop comment as well.
Thanks @danfrankj ! I've pushed a commit to address those nits |
|
Hi @gthomas-slack ! Thanks for the patch! Merging it in now! [I'll put out a new release soon]. FYI: Eventually, I had planned to migrate |
|
Thanks @matthewwardrop ! Ah interesting - if/when it comes time to fully switchover to |
pyhivesupports passing through a custom requests session for advanced usage such as custom headers, cookie values, retry logic, etc - https://github.com/dropbox/PyHive/blob/master/pyhive/presto.py#L115This PR adds support for passing through a custom requests session to
pyhivewhen creating anomniductPrestoClient.