@@ -616,7 +616,9 @@ def _check_not_closed(self):
616
616
session_id_hex = self .connection .get_session_id_hex (),
617
617
)
618
618
619
- def _validate_staging_http_response (self , response : requests .Response , operation_name : str = "staging operation" ) -> None :
619
+ def _validate_staging_http_response (
620
+ self , response : requests .Response , operation_name : str = "staging operation"
621
+ ) -> None :
620
622
621
623
# Check response codes
622
624
OK = requests .codes .ok # 200
@@ -634,11 +636,14 @@ def _validate_staging_http_response(self, response: requests.Response, operation
634
636
logger .debug (
635
637
"Response code %s from server indicates %s was accepted "
636
638
"but not yet applied on the server. It's possible this command may fail later." ,
637
- ACCEPTED , operation_name
639
+ ACCEPTED ,
640
+ operation_name ,
638
641
)
639
642
640
643
def _handle_staging_operation (
641
- self , staging_allowed_local_path : Union [None , str , List [str ]], input_stream : Optional [BinaryIO ] = None
644
+ self ,
645
+ staging_allowed_local_path : Union [None , str , List [str ]],
646
+ input_stream : Optional [BinaryIO ] = None ,
642
647
):
643
648
"""Fetch the HTTP request instruction from a staging ingestion command
644
649
and call the designated handler.
@@ -713,7 +718,8 @@ def _handle_staging_operation(
713
718
714
719
logger .debug (
715
720
"Attempting staging operation indicated by server: %s - %s" ,
716
- row .operation , getattr (row , 'localFile' , '' )
721
+ row .operation ,
722
+ getattr (row , "localFile" , "" ),
717
723
)
718
724
719
725
# TODO: Create a retry loop here to re-attempt if the request times out or fails
@@ -885,9 +891,7 @@ def execute(
885
891
)
886
892
elif param_approach == ParameterApproach .NATIVE :
887
893
normalized_parameters = self ._normalize_tparametercollection (parameters )
888
- param_structure = self ._determine_parameter_structure (
889
- normalized_parameters
890
- )
894
+ param_structure = self ._determine_parameter_structure (normalized_parameters )
891
895
transformed_operation = transform_paramstyle (
892
896
operation , normalized_parameters , param_structure
893
897
)
@@ -913,7 +917,7 @@ def execute(
913
917
if self .active_result_set and self .active_result_set .is_staging_operation :
914
918
self ._handle_staging_operation (
915
919
staging_allowed_local_path = self .connection .staging_allowed_local_path ,
916
- input_stream = input_stream
920
+ input_stream = input_stream ,
917
921
)
918
922
919
923
return self
0 commit comments