Skip to content

Commit 00d8a49

Browse files
author
Jesse Whitehouse
committed
Fix mypy static type failures
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
1 parent 0261b7a commit 00d8a49

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/databricks/sql/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def _check_not_closed(self):
300300
if not self.open:
301301
raise Error("Attempting operation on closed cursor")
302302

303-
def _handle_staging_operation(self, staging_allowed_local_path: Union[List, str]):
303+
def _handle_staging_operation(self, staging_allowed_local_path: Union[None, str, List[str]]):
304304
"""Fetch the HTTP request instruction from a staging ingestion command
305305
and call the designated handler.
306306
@@ -319,7 +319,9 @@ def _handle_staging_operation(self, staging_allowed_local_path: Union[List, str]
319319

320320
abs_staging_allowed_local_paths = [os.path.abspath(i) for i in _staging_allowed_local_paths]
321321

322+
assert self.active_result_set is not None
322323
row = self.active_result_set.fetchone()
324+
assert row is not None
323325

324326
# Must set to None in cases where server response does not include localFile
325327
abs_localFile = None

src/databricks/sql/thrift_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
http_path: str,
6363
http_headers,
6464
auth_provider: AuthProvider,
65-
staging_allowed_local_path: Union[str, List] = None,
65+
staging_allowed_local_path: Union[None, str, List[str]] = None,
6666
**kwargs,
6767
):
6868
# Internal arguments in **kwargs:

0 commit comments

Comments
 (0)