3030from rohmu .object_storage .config import ( # noqa: F401
3131 AZURE_ENDPOINT_SUFFIXES as ENDPOINT_SUFFIXES ,
3232 AZURE_MAX_BLOCK_SIZE as MAX_BLOCK_SIZE ,
33+ AZURE_MAX_NUM_PARTS_PER_UPLOAD as MAX_NUM_PARTS_PER_UPLOAD ,
3334 AzureObjectStorageConfig as Config ,
3435 calculate_azure_max_block_size as calculate_max_block_size ,
3536)
@@ -139,6 +140,9 @@ def create_object_store_if_needed(self) -> None:
139140 else :
140141 raise TransferObjectStoreInitializationError () from ex
141142
143+ def calculate_max_unknown_file_size (self ) -> int :
144+ return MAX_NUM_PARTS_PER_UPLOAD * MAX_BLOCK_SIZE
145+
142146 def get_blob_service_client (self ) -> BlobServiceClient :
143147 if self ._blob_service_client is None :
144148 self ._blob_service_client = BlobServiceClient .from_connection_string (
@@ -178,7 +182,7 @@ def conn_string(
178182 def copy_file (
179183 self , * , source_key : str , destination_key : str , metadata : Optional [Metadata ] = None , ** kwargs : Any
180184 ) -> None :
181- timeout = kwargs .get ("timeout" ) or 15.0
185+ timeout = kwargs .get ("timeout" ) or 15
182186 self ._copy_file_from_bucket (
183187 source_bucket = self , source_key = source_key , destination_key = destination_key , metadata = metadata , timeout = timeout
184188 )
@@ -190,7 +194,7 @@ def _copy_file_from_bucket(
190194 source_key : str ,
191195 destination_key : str ,
192196 metadata : Optional [Metadata ] = None ,
193- timeout : float = 15.0 ,
197+ timeout : int = 15 ,
194198 ) -> None :
195199 source_path = source_bucket .format_key_for_backend (source_key , remove_slash_prefix = True , trailing_slash = False )
196200 source_client = source_bucket .get_blob_service_client ().get_blob_client (source_bucket .container_name , source_path )
0 commit comments