ingestion: group oversize and binary rejections in the report
This commit is contained in:
@@ -54,7 +54,14 @@ class Harvest:
|
|||||||
def rejection_summary(self) -> dict:
|
def rejection_summary(self) -> dict:
|
||||||
counts = {}
|
counts = {}
|
||||||
for row in self.rejections:
|
for row in self.rejections:
|
||||||
key = f"{row.get('platform')}/{row.get('reason')}"
|
reason = str(row.get("reason") or "unknown")
|
||||||
|
# Keep the summary readable: 200 distinct oversize byte counts are
|
||||||
|
# one finding, not two hundred.
|
||||||
|
if reason.startswith("oversize"):
|
||||||
|
reason = "oversize"
|
||||||
|
elif reason.startswith("binary"):
|
||||||
|
reason = "binary"
|
||||||
|
key = f"{row.get('platform')}/{reason}"
|
||||||
counts[key] = counts.get(key, 0) + 1
|
counts[key] = counts.get(key, 0) + 1
|
||||||
return dict(sorted(counts.items()))
|
return dict(sorted(counts.items()))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user