@@ -212,10 +212,11 @@ def create_distributions_from_metadata(metadata: List[Dict[str, Union[str, int]]
212212 ----------
213213 metadata : List[Dict[str, Union[str, int]]]
214214 List of metadata entries, each containing:
215- - filename: str - Name of the file
216215 - checksum: str - SHA-256 hex digest (64 characters)
217216 - size: int - File size in bytes (positive integer)
218217 - url: str - Download URL for the file
218+ - file_format: str - File format of the file [optional]
219+ - compression: str - Compression format of the file [optional]
219220
220221 Returns
221222 -------
@@ -227,21 +228,20 @@ def create_distributions_from_metadata(metadata: List[Dict[str, Union[str, int]]
227228
228229 for entry in metadata :
229230 # Validate required keys
230- required_keys = ["filename" , " checksum" , "size" , "url" ]
231+ required_keys = ["checksum" , "size" , "url" ]
231232 missing_keys = [key for key in required_keys if key not in entry ]
232233 if missing_keys :
233234 raise ValueError (f"Metadata entry missing required keys: { missing_keys } " )
234235
235- filename = entry ["filename" ]
236236 checksum = entry ["checksum" ]
237237 size = entry ["size" ]
238- if not isinstance (size , int ) or size <= 0 :
239- raise ValueError (f"Invalid size for { filename } : expected positive integer, got { size } " )
240238 url = entry ["url" ]
239+ if not isinstance (size , int ) or size <= 0 :
240+ raise ValueError (f"Invalid size for { url } : expected positive integer, got { size } " )
241241 # Validate SHA-256 hex digest (64 hex chars)
242242 if not isinstance (checksum , str ) or len (checksum ) != 64 or not all (
243243 c in '0123456789abcdefABCDEF' for c in checksum ):
244- raise ValueError (f"Invalid checksum for { filename } " )
244+ raise ValueError (f"Invalid checksum for { url } " )
245245
246246 distributions .append (
247247 create_distribution (
@@ -488,7 +488,7 @@ def deploy_from_metadata(
488488 print (f"Successfully deployed to { version_id } " )
489489 print (f"Deployed { len (metadata )} file(s):" )
490490 for entry in metadata :
491- print (f" - { entry ['filename ' ]} " )
491+ print (f" - { entry ['url ' ]} " )
492492
493493
494494def __download_file__ (url , filename , vault_token_file = None , auth_url = None , client_id = None ) -> None :
0 commit comments