Skip to content

Commit

Permalink
Merge pull request #3 from remerge/SCIENCE-210-patch-ghost-objects
Browse files Browse the repository at this point in the history
Implemented "ghost" files skipping
  • Loading branch information
VOvchinnikov committed May 23, 2024
2 parents d7a2e09 + e9c9015 commit 9c3f611
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,19 @@ async def _list_objects(self, path, prefix="", versions=False, **kwargs):
return [await self._get_object(path)]
else:
return []
out = pseudodirs + items
dirty_out = pseudodirs + items

out = []
for entry in dirty_out:
if (
entry["name"].rstrip("/") == path
and entry.get("kind", "") == "storage#object"
and (entry.get("size", "") == "0" or entry.get("size", "") == 0)
and entry.get("crc32c", "") == "AAAAAA=="
):
# this is the "ghost" object of an empty folder, skip it
continue
out.append(entry)

use_snapshot_listing = inventory_report_info and inventory_report_info.get(
"use_snapshot_listing"
Expand Down

0 comments on commit 9c3f611

Please sign in to comment.