diff --git a/sdks/python/apache_beam/io/gcp/gcsio.py b/sdks/python/apache_beam/io/gcp/gcsio.py index 087d32a9e054..a6ba82a6e07c 100644 --- a/sdks/python/apache_beam/io/gcp/gcsio.py +++ b/sdks/python/apache_beam/io/gcp/gcsio.py @@ -208,7 +208,8 @@ def delete_batch(self, paths): """Deletes the objects at the given GCS paths. Args: - paths: List of GCS file path patterns in the form gs:///, + paths: List of GCS file path patterns or Dict with GCS file path patterns + as keys. The patterns are in the form gs:///, but not to exceed MAX_BATCH_OPERATION_SIZE in length. Returns: List of tuples of (path, exception) in the same order as the @@ -217,6 +218,7 @@ def delete_batch(self, paths): """ final_results = [] s = 0 + if not isinstance(paths, list): paths = list(iter(paths)) while s < len(paths): if (s + MAX_BATCH_OPERATION_SIZE) < len(paths): current_paths = paths[s:s + MAX_BATCH_OPERATION_SIZE]