@@ -125,6 +125,8 @@ def __init__(
125125
126126 super ().__init__ (ssl_options = ssl_options , ** kwargs )
127127
128+ self .use_hybrid_disposition = kwargs .get ("use_hybrid_disposition" , False )
129+
128130 # Extract warehouse ID from http_path
129131 self .warehouse_id = self ._extract_warehouse_id (http_path )
130132
@@ -449,7 +451,11 @@ def execute_command(
449451 ResultFormat .ARROW_STREAM if use_cloud_fetch else ResultFormat .JSON_ARRAY
450452 ).value
451453 disposition = (
452- ResultDisposition .EXTERNAL_LINKS
454+ (
455+ ResultDisposition .HYBRID
456+ if self .use_hybrid_disposition
457+ else ResultDisposition .EXTERNAL_LINKS
458+ )
453459 if use_cloud_fetch
454460 else ResultDisposition .INLINE
455461 ).value
@@ -630,7 +636,7 @@ def get_execution_result(
630636 arraysize = cursor .arraysize ,
631637 )
632638
633- def get_chunk_link (self , statement_id : str , chunk_index : int ) -> ExternalLink :
639+ def get_chunk_links (self , statement_id : str , chunk_index : int ) -> List [ ExternalLink ] :
634640 """
635641 Get links for chunks starting from the specified index.
636642 Args:
@@ -647,17 +653,7 @@ def get_chunk_link(self, statement_id: str, chunk_index: int) -> ExternalLink:
647653 response = GetChunksResponse .from_dict (response_data )
648654
649655 links = response .external_links
650- link = next ((l for l in links if l .chunk_index == chunk_index ), None )
651- if not link :
652- raise ServerOperationError (
653- f"No link found for chunk index { chunk_index } " ,
654- {
655- "operation-id" : statement_id ,
656- "diagnostic-info" : None ,
657- },
658- )
659-
660- return link
656+ return links
661657
662658 # == Metadata Operations ==
663659
0 commit comments