Fokko commented on code in PR #6034:
URL: https://github.com/apache/iceberg/pull/6034#discussion_r1025572171


##########
python/pyiceberg/catalog/__init__.py:
##########
@@ -134,6 +155,44 @@ def load_catalog(name: str, **properties: Optional[str]) 
-> Catalog:
     raise ValueError(f"Could not initialize catalog with the following 
properties: {properties}")
 
 
+def delete_files(io: FileIO, files_to_delete: set[str], file_type: str) -> 
None:
+    """Helper to delete files.
+
+    Log warnings if failing to delete any file
+
+    Args:
+        io: The FileIO used to delete the object
+        files_to_delete: A set of file paths to be deleted
+        file_type: The type of the file
+    """
+    for file in files_to_delete:
+        try:
+            io.delete(file)
+        except OSError as exc:
+            logger.warning(msg=f"Failed to delete {file_type} file {file}", 
exc_info=exc)
+
+
+def delete_data_files(io: FileIO, manifests_to_delete: list[ManifestFile]) -> 
None:

Review Comment:
   ```suggestion
   def delete_data_files(io: FileIO, manifests_to_delete: List[ManifestFile]) 
-> None:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to