Skip to content

Commit

Permalink
Corrected the "ghost" item check to be more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
VOvchinnikov committed Sep 15, 2023
1 parent 053b956 commit 55d0268
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,12 @@ def _filter_ghost_items(items):
filtered_items = []

for item in items:
if item.get("kind", "") != "storage#object" \
and item.get("size", "0") != "0" \
and item.get("crc32c", "") != "AAAAAA==":
filtered_items.append(item)
if item.get("kind", "") == "storage#object" \
and item.get("size", "") == "0" \
and item.get("crc32c", "") == "AAAAAA==":
# This is a ghost item, skip it
continue
filtered_items.append(item)

return filtered_items

Expand Down

0 comments on commit 55d0268

Please sign in to comment.