Skip to content

Commit cb81272

Browse files
return the old result_links default (#5)
Return the old result_links default, make the type optional, & I'm pretty sure the original problem is that add_file_links can't take a None, so these statements should be in the body of the if-statement that ensures it is not None Signed-off-by: wyattscarpenter <[email protected]>
1 parent ae1942f commit cb81272

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/databricks/sql/utils.py

100755100644
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from collections.abc import Iterable
88
from decimal import Decimal
99
from enum import Enum
10-
from typing import Any, Dict, List, Union
10+
from typing import Any, Dict, List, Optional, Union
1111
import re
1212

1313
import lz4.frame
@@ -134,7 +134,7 @@ def __init__(
134134
schema_bytes,
135135
max_download_threads: int,
136136
start_row_offset: int = 0,
137-
result_links: List[TSparkArrowResultLink] = [],
137+
result_links: Optional[List[TSparkArrowResultLink]] = None,
138138
lz4_compressed: bool = True,
139139
description: List[List[Any]] = None,
140140
):
@@ -161,17 +161,17 @@ def __init__(
161161
start_row_offset
162162
)
163163
)
164-
for result_link in result_links:
165-
logger.debug(
166-
"- start row offset: {}, row count: {}".format(
167-
result_link.startRowOffset, result_link.rowCount
164+
if result_links is not None:
165+
for result_link in result_links:
166+
logger.debug(
167+
"- start row offset: {}, row count: {}".format(
168+
result_link.startRowOffset, result_link.rowCount
169+
)
168170
)
171+
self.download_manager = ResultFileDownloadManager(
172+
self.max_download_threads, self.lz4_compressed
169173
)
170-
171-
self.download_manager = ResultFileDownloadManager(
172-
self.max_download_threads, self.lz4_compressed
173-
)
174-
self.download_manager.add_file_links(result_links)
174+
self.download_manager.add_file_links(result_links)
175175

176176
self.table = self._create_next_table()
177177
self.table_row_index = 0

0 commit comments

Comments
 (0)