Memory Optimization Draft one complete

This commit is contained in:
=
2025-09-01 20:19:11 -04:00
parent 7ef5a83ff2
commit 67615f364c
14 changed files with 440 additions and 158 deletions
+26
View File
@@ -17,6 +17,7 @@ import pandas as pd
import os
from itertools import chain
import ast
import re
@@ -134,3 +135,28 @@ def filter_and_drop(approved, eligiblepaths, min_hashes):
filtered = filtered[filtered['sha256'].apply(len) >= min_hashes]
return filtered
def inspect_parquet(path):
try:
df = pd.read_parquet(path)
print(f"✅ Successfully read: {path}")
print(f"📄 Columns: {df.columns.tolist()}")
print(f"🔢 Rows: {len(df)}")
return df
except Exception as e:
print(f"❌ Error reading {path}: {e}")
return pd.DataFrame()
def regulator(paths, case_insensitive=True):
"""
Build a Python raw string regex that matches any of the given Windows path fragments.
"""
escaped = [re.escape(p) for p in paths]
pattern = "(?:" + "|".join(escaped) + ")"
if case_insensitive:
pattern = pattern
print(f"Regulator is providing {pattern}")
return f'r"{pattern}"'