@@ -124,15 +124,19 @@ def __init__(
124124 http_path ,
125125 )
126126
127- super ().__init__ (ssl_options = ssl_options , ** kwargs )
127+ self ._max_download_threads = kwargs .get ("max_download_threads" , 10 )
128+ self ._ssl_options = ssl_options
129+ self ._use_arrow_native_complex_types = kwargs .get (
130+ "_use_arrow_native_complex_types" , True
131+ )
128132
129133 self .use_hybrid_disposition = kwargs .get ("use_hybrid_disposition" , True )
130134
131135 # Extract warehouse ID from http_path
132136 self .warehouse_id = self ._extract_warehouse_id (http_path )
133137
134138 # Initialize HTTP client
135- self .http_client = SeaHttpClient (
139+ self ._http_client = SeaHttpClient (
136140 server_hostname = server_hostname ,
137141 port = port ,
138142 http_path = http_path ,
@@ -224,7 +228,7 @@ def open_session(
224228 schema = schema ,
225229 )
226230
227- response = self .http_client ._make_request (
231+ response = self ._http_client ._make_request (
228232 method = "POST" , path = self .SESSION_PATH , data = request_data .to_dict ()
229233 )
230234
@@ -264,7 +268,7 @@ def close_session(self, session_id: SessionId) -> None:
264268 session_id = sea_session_id ,
265269 )
266270
267- self .http_client ._make_request (
271+ self ._http_client ._make_request (
268272 method = "DELETE" ,
269273 path = self .SESSION_PATH_WITH_ID .format (sea_session_id ),
270274 data = request_data .to_dict (),
@@ -443,7 +447,9 @@ def execute_command(
443447 sea_parameters .append (
444448 StatementParameter (
445449 name = param .name ,
446- value = param .value ,
450+ value = (
451+ param .value .stringValue if param .value is not None else None
452+ ),
447453 type = param .type ,
448454 )
449455 )
@@ -477,7 +483,7 @@ def execute_command(
477483 result_compression = result_compression ,
478484 )
479485
480- response_data = self .http_client ._make_request (
486+ response_data = self ._http_client ._make_request (
481487 method = "POST" , path = self .STATEMENT_PATH , data = request .to_dict ()
482488 )
483489 response = ExecuteStatementResponse .from_dict (response_data )
@@ -522,7 +528,7 @@ def cancel_command(self, command_id: CommandId) -> None:
522528 raise ValueError ("Not a valid SEA command ID" )
523529
524530 request = CancelStatementRequest (statement_id = sea_statement_id )
525- self .http_client ._make_request (
531+ self ._http_client ._make_request (
526532 method = "POST" ,
527533 path = self .CANCEL_STATEMENT_PATH_WITH_ID .format (sea_statement_id ),
528534 data = request .to_dict (),
@@ -547,7 +553,7 @@ def close_command(self, command_id: CommandId) -> None:
547553 raise ValueError ("Not a valid SEA command ID" )
548554
549555 request = CloseStatementRequest (statement_id = sea_statement_id )
550- self .http_client ._make_request (
556+ self ._http_client ._make_request (
551557 method = "DELETE" ,
552558 path = self .STATEMENT_PATH_WITH_ID .format (sea_statement_id ),
553559 data = request .to_dict (),
@@ -575,7 +581,7 @@ def get_query_state(self, command_id: CommandId) -> CommandState:
575581 raise ValueError ("Not a valid SEA command ID" )
576582
577583 request = GetStatementRequest (statement_id = sea_statement_id )
578- response_data = self .http_client ._make_request (
584+ response_data = self ._http_client ._make_request (
579585 method = "GET" ,
580586 path = self .STATEMENT_PATH_WITH_ID .format (sea_statement_id ),
581587 data = request .to_dict (),
@@ -615,7 +621,7 @@ def get_execution_result(
615621 request = GetStatementRequest (statement_id = sea_statement_id )
616622
617623 # Get the statement result
618- response_data = self .http_client ._make_request (
624+ response_data = self ._http_client ._make_request (
619625 method = "GET" ,
620626 path = self .STATEMENT_PATH_WITH_ID .format (sea_statement_id ),
621627 data = request .to_dict (),
@@ -649,13 +655,13 @@ def get_chunk_links(
649655 ExternalLink: External link for the chunk
650656 """
651657
652- response_data = self .http_client ._make_request (
658+ response_data = self ._http_client ._make_request (
653659 method = "GET" ,
654660 path = self .CHUNK_PATH_WITH_ID_AND_INDEX .format (statement_id , chunk_index ),
655661 )
656662 response = GetChunksResponse .from_dict (response_data )
657663
658- links = response .external_links
664+ links = response .external_links or []
659665 return links
660666
661667 # == Metadata Operations ==
0 commit comments