Skip to content

Commit

Permalink
Fix MyPy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
  • Loading branch information
kravets-levko committed Aug 14, 2024
1 parent 296b02f commit af91cf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/databricks/sql/auth/thrift_http_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import base64
import logging
import urllib.parse
from typing import Dict, Union
from typing import Dict, Union, Optional

import six
import thrift
Expand All @@ -26,7 +26,7 @@ def __init__(
uri_or_host,
port=None,
path=None,
ssl_options: SSLOptions = None,
ssl_options: Optional[SSLOptions] = None,
max_connections: int = 1,
retry_policy: Union[DatabricksRetryPolicy, int] = 0,
):
Expand All @@ -48,10 +48,11 @@ def __init__(
self.scheme = parsed.scheme
assert self.scheme in ("http", "https")
if self.scheme == "https":
# TODO: Not sure if those options are used anywhere - need to double-check
self.certfile = self._ssl_options.tls_client_cert_file
self.keyfile = self._ssl_options.tls_client_cert_key_file
self.context = self._ssl_options.create_ssl_context()
if self._ssl_options is not None:
# TODO: Not sure if those options are used anywhere - need to double-check
self.certfile = self._ssl_options.tls_client_cert_file
self.keyfile = self._ssl_options.tls_client_cert_key_file
self.context = self._ssl_options.create_ssl_context()
self.port = parsed.port
self.host = parsed.hostname
self.path = parsed.path
Expand Down
4 changes: 2 additions & 2 deletions src/databricks/sql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class SSLOptions:

def __init__(
self,
tls_verify: Optional[bool] = True,
tls_verify_hostname: Optional[bool] = True,
tls_verify: bool = True,
tls_verify_hostname: bool = True,
tls_trusted_ca_file: Optional[str] = None,
tls_client_cert_file: Optional[str] = None,
tls_client_cert_key_file: Optional[str] = None,
Expand Down

0 comments on commit af91cf0

Please sign in to comment.