Skip to content

Commit 238dc0a

Browse files
only call get_chunk_link with non null chunk index
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 27b781f commit 238dc0a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/databricks/sql/cloud_fetch_queue.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ def __init__(
306306
description: Column descriptions
307307
"""
308308
super().__init__(
309-
schema_bytes=b"",
310309
max_download_threads=max_download_threads,
311310
ssl_options=ssl_options,
312311
lz4_compressed=lz4_compressed,
@@ -357,17 +356,19 @@ def _progress_chunk_link(self):
357356

358357
next_chunk_index = self._current_chunk_link.next_chunk_index
359358

360-
self._current_chunk_link = None
361-
try:
362-
self._current_chunk_link = self._sea_client.get_chunk_link(
363-
self._statement_id, next_chunk_index
364-
)
365-
except Exception as e:
366-
logger.error(
367-
"SeaCloudFetchQueue: Error fetching link for chunk {}: {}".format(
368-
next_chunk_index, e
359+
if next_chunk_index is None:
360+
self._current_chunk_link = None
361+
else:
362+
try:
363+
self._current_chunk_link = self._sea_client.get_chunk_link(
364+
self._statement_id, next_chunk_index
365+
)
366+
except Exception as e:
367+
logger.error(
368+
"SeaCloudFetchQueue: Error fetching link for chunk {}: {}".format(
369+
next_chunk_index, e
370+
)
369371
)
370-
)
371372
logger.debug(
372373
f"SeaCloudFetchQueue: Progressed to link for chunk {next_chunk_index}: {self._current_chunk_link}"
373374
)

0 commit comments

Comments
 (0)