MCPcopy Create free account
hub / github.com/pyathena-dev/PyAthena / rm

Method rm

pyathena/filesystem/s3.py:761–769  ·  view source on GitHub ↗
(self, path, recursive=False, maxdepth=None, **kwargs)

Source from the content-addressed store, hash-verified

759 self.invalidate_cache(path)
760
761 def rm(self, path, recursive=False, maxdepth=None, **kwargs) -> None:
762 bucket, key, version_id = self.parse_path(path)
763 if not key:
764 raise ValueError("Cannot delete the bucket.")
765
766 expand_path = self.expand_path(path, recursive=recursive, maxdepth=maxdepth)
767 self._delete_objects(bucket, expand_path, **kwargs)
768 for p in expand_path:
769 self.invalidate_cache(p)
770
771 def _delete_object(
772 self, bucket: str, key: str, version_id: str | None = None, **kwargs

Callers 2

test_rmMethod · 0.80
test_rm_recursiveMethod · 0.80

Calls 3

parse_pathMethod · 0.95
_delete_objectsMethod · 0.95
invalidate_cacheMethod · 0.95

Tested by 2

test_rmMethod · 0.64
test_rm_recursiveMethod · 0.64