Skip to content
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

Expose verify parameter on dbapi.connect #31

Merged
merged 1 commit into from
Jun 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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