Added File Extension Limits

This commit is contained in:
=
2025-09-15 16:00:31 -04:00
parent a3977565f2
commit d65880135f
2 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -69,6 +69,7 @@ def split_filepaths_grouped(df, col="filename", group_parts=4, min_parts=4):
row["longestcfp"] = prefix_str
row["middle"] = middle
row["filename_only"] = filename
row["file_extension"] = os.path.splitext(filename)[1]
new_rows.append(row)
return pd.DataFrame(new_rows).drop(columns=["group_key"])
@@ -175,7 +176,7 @@ def generatePathReview(first_policy, second_policy, badpathparts, min_files_for_
lcp_not_forbidden = haslcp[~forbidden_lcfp].copy()
#For the review, drop down to only the columns we care, and then group by the commmon file path, consolidating and dropping dupes
lcp_not_forbidden_review = lcp_not_forbidden[['longestcfp', 'middle', 'filename_only', 'sha256']]
lcp_not_forbidden_review = lcp_not_forbidden[['longestcfp', 'middle', 'filename_only', 'file_extension', 'sha256']]
# Count unique sha256 per longestcfp
unique_sha_counts = lcp_not_forbidden_review.groupby('longestcfp')['sha256'].nunique().reset_index()