Skip to content

Commit

Permalink
Properly ignore delete markers in the inventory report
Browse files Browse the repository at this point in the history
  • Loading branch information
seligman committed Aug 29, 2022
1 parent a03cd87 commit 62ba3f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion s3_abstraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ def get_bucket_inventory(msg, s3, bucket, required_fields=set(), prefix=""):
cr = csv.reader(sr)
for row in cr:
# Merge the schema and each row
yield {x: y for x, y in zip(schema, row)}
row = {x: y for x, y in zip(schema, row)}
# Ignore Delete Markers and other objects that don't have a size
if len(row['Size']) > 0:
yield row

# We're done with this report, don't move on to the next one
break
Expand Down

0 comments on commit 62ba3f2

Please sign in to comment.