Skip to content

Commit 7958cd9

Browse files
allow empty cloudfetch result
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent c621c0c commit 7958cd9

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,9 @@ def build_queue(
7474
raise ValueError(
7575
"SEA client is required for EXTERNAL_LINKS disposition"
7676
)
77-
if not result_data.external_links:
78-
raise ValueError(
79-
"External links are required for EXTERNAL_LINKS disposition"
80-
)
8177

8278
return SeaCloudFetchQueue(
83-
initial_links=result_data.external_links,
79+
initial_links=result_data.external_links or [],
8480
max_download_threads=max_download_threads,
8581
ssl_options=ssl_options,
8682
sea_client=sea_client,
@@ -163,7 +159,7 @@ def __init__(
163159

164160
initial_link = next((l for l in initial_links if l.chunk_index == 0), None)
165161
if not initial_link:
166-
raise ValueError("No initial link found for chunk index 0")
162+
return
167163

168164
self.download_manager = ResultFileDownloadManager(
169165
links=[],

tests/e2e/test_driver.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def test_incorrect_query_throws_exception(self):
368368
},
369369
{
370370
"use_sea": True,
371-
}
371+
},
372372
],
373373
)
374374
def test_create_table_will_return_empty_result_set(self, extra_params):
@@ -581,7 +581,7 @@ def test_get_catalogs(self):
581581
},
582582
{
583583
"use_sea": True,
584-
}
584+
},
585585
],
586586
)
587587
def test_get_arrow(self, extra_params):
@@ -657,7 +657,7 @@ def execute_really_long_query():
657657
},
658658
{
659659
"use_sea": True,
660-
}
660+
},
661661
],
662662
)
663663
def test_can_execute_command_after_failure(self, extra_params):
@@ -682,7 +682,7 @@ def test_can_execute_command_after_failure(self, extra_params):
682682
},
683683
{
684684
"use_sea": True,
685-
}
685+
},
686686
],
687687
)
688688
def test_can_execute_command_after_success(self, extra_params):
@@ -709,7 +709,7 @@ def generate_multi_row_query(self):
709709
},
710710
{
711711
"use_sea": True,
712-
}
712+
},
713713
],
714714
)
715715
def test_fetchone(self, extra_params):
@@ -756,7 +756,7 @@ def test_fetchall(self, extra_params):
756756
},
757757
{
758758
"use_sea": True,
759-
}
759+
},
760760
],
761761
)
762762
def test_fetchmany_when_stride_fits(self, extra_params):
@@ -779,7 +779,7 @@ def test_fetchmany_when_stride_fits(self, extra_params):
779779
},
780780
{
781781
"use_sea": True,
782-
}
782+
},
783783
],
784784
)
785785
def test_fetchmany_in_excess(self, extra_params):
@@ -802,7 +802,7 @@ def test_fetchmany_in_excess(self, extra_params):
802802
},
803803
{
804804
"use_sea": True,
805-
}
805+
},
806806
],
807807
)
808808
def test_iterator_api(self, extra_params):
@@ -890,7 +890,7 @@ def test_timestamps_arrow(self):
890890
},
891891
{
892892
"use_sea": True,
893-
}
893+
},
894894
],
895895
)
896896
def test_multi_timestamps_arrow(self, extra_params):

0 commit comments

Comments
 (0)