Skip to content

Commit 41f1130

Browse files
Merge branch 'ext-links-sea' into sea-http-client
2 parents 01c9b95 + 28c6bb1 commit 41f1130

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

src/databricks/sql/backend/sea/queue.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,8 @@ def __init__(
150150
initial_links = result_data.external_links or []
151151
first_link = next((l for l in initial_links if l.chunk_index == 0), None)
152152
if not first_link:
153-
raise ServerOperationError(
154-
"No initial link found for chunk 0",
155-
{
156-
"operation-id": statement_id,
157-
"diagnostic-info": None,
158-
},
159-
)
153+
# possibly an empty response
154+
return None
160155

161156
# Track the current chunk we're processing
162157
self._current_chunk_link = first_link

tests/unit/test_sea_queue.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +378,17 @@ def test_init_no_initial_links(
378378
):
379379
"""Test initialization with no initial links."""
380380
# Create a queue with empty initial links
381-
with pytest.raises(
382-
ServerOperationError, match="No initial link found for chunk 0"
383-
):
384-
queue = SeaCloudFetchQueue(
385-
result_data=ResultData(external_links=[]),
386-
max_download_threads=5,
387-
ssl_options=ssl_options,
388-
sea_client=mock_sea_client,
389-
statement_id="test-statement-123",
390-
total_chunk_count=0,
391-
lz4_compressed=False,
392-
description=description,
393-
)
381+
queue = SeaCloudFetchQueue(
382+
result_data=ResultData(external_links=[]),
383+
max_download_threads=5,
384+
ssl_options=ssl_options,
385+
sea_client=mock_sea_client,
386+
statement_id="test-statement-123",
387+
total_chunk_count=0,
388+
lz4_compressed=False,
389+
description=description,
390+
)
391+
assert queue.table is None
394392

395393
@patch("databricks.sql.backend.sea.queue.logger")
396394
def test_progress_chunk_link_no_current_link(self, mock_logger):

0 commit comments

Comments
 (0)