File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ class File(BaseModel):
3030 Private Attributes:
3131 _size (int): Size of the file in bytes.
3232 _unchanged_data (bool): Indicates if the file data has not changed since last upload.
33+ _enforce_metadata_update (bool): Indicates if metadata update is enforced.
3334 _is_inside_zip (bool): Indicates if the file is packaged inside a zip archive.
3435
3536 Methods:
@@ -60,6 +61,7 @@ class File(BaseModel):
6061
6162 _size : int = PrivateAttr (default = 0 )
6263 _unchanged_data : bool = PrivateAttr (default = False )
64+ _enforce_metadata_update : bool = PrivateAttr (default = False )
6365 _is_inside_zip : bool = PrivateAttr (default = False )
6466
6567 def extract_file_name (self ):
Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ async def native_upload(
9595 files_new_metadata = [file for file in files if file .to_replace and file ._unchanged_data ]
9696 files_replace = [file for file in files if file .to_replace and not file ._unchanged_data ]
9797
98+ # These are not in a package but need a metadtata update, ensure even for zips
99+ for file in files_new_metadata :
100+ file ._enforce_metadata_update = True
101+
98102 async with httpx .AsyncClient (** session_params ) as session :
99103 with tempfile .TemporaryDirectory () as tmp_dir :
100104 packages = distribute_files (files_new )
@@ -369,7 +373,10 @@ async def _update_metadata(
369373 try :
370374 if _tab_extension (dv_path ) in file_mapping :
371375 file_id = file_mapping [_tab_extension (dv_path )]
372- elif file .file_name and _is_zip (file .file_name ) and not file ._is_inside_zip :
376+ elif (
377+ file .file_name and _is_zip (file .file_name )
378+ and not file ._is_inside_zip and not file ._enforce_metadata_update
379+ ):
373380 # When the file is a zip package it will be unpacked and thus
374381 # the expected file name of the zip will not be in the
375382 # dataset, since it has been unpacked.
You can’t perform that action at this time.
0 commit comments