Skip to content

Commit

Permalink
Expose verify parameter on dbapi.connect
Browse files Browse the repository at this point in the history
This resolves #29
  • Loading branch information
caiopavanelli authored and electrum committed Jun 26, 2020
1 parent 58c7940 commit 836ed92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions presto/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def __init__(
max_attempts=MAX_ATTEMPTS, # type: int
request_timeout=constants.DEFAULT_REQUEST_TIMEOUT, # type: Union[float, Tuple[float, float]]
handle_retry=exceptions.RetryWithExponentialBackoff(),
verify=True # type: Any
):
# type: (...) -> None
self._client_session = ClientSession(
Expand All @@ -230,6 +231,7 @@ def __init__(
else:
# mypy cannot follow module import
self._http_session = self.http.Session() # type: ignore
self._http_session.verify = verify
self._http_session.headers.update(self.http_headers)
self._exceptions = self.HTTP_EXCEPTIONS
self._auth = auth
Expand Down
2 changes: 2 additions & 0 deletions presto/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __init__(
max_attempts=constants.DEFAULT_MAX_ATTEMPTS,
request_timeout=constants.DEFAULT_REQUEST_TIMEOUT,
isolation_level=IsolationLevel.AUTOCOMMIT,
verify=True
):
self.host = host
self.port = port
Expand All @@ -85,6 +86,7 @@ def __init__(
self.session_properties = session_properties
# mypy cannot follow module import
self._http_session = presto.client.PrestoRequest.http.Session()
self._http_session.verify = verify
self.http_headers = http_headers
self.http_scheme = http_scheme
self.auth = auth
Expand Down

0 comments on commit 836ed92

Please sign in to comment.