From 3f2717d972d811b0615f9b250aeb5191b255aa47 Mon Sep 17 00:00:00 2001 From: brotoskyj Date: Wed, 3 Sep 2025 17:04:47 -0400 Subject: [PATCH] Fixed List --- AirlockTools.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AirlockTools.py b/AirlockTools.py index e8dc74e..0e13021 100644 --- a/AirlockTools.py +++ b/AirlockTools.py @@ -434,12 +434,13 @@ def menu_prepare_to_enforce(): allowbyhash.to_parquet(f"parquet\\final_hash_approvals_{first_policy}_{second_policy}.parquet", index=False) easyview = allowbyhash.groupby('sha256').agg(list).reset_index() - # Deduplicate all list columns in easyview + # Deduplicate and sort by first item in list for col in easyview.columns: - if col != 'sha256': # Skip the grouping column + if col != 'sha256': easyview[col] = easyview[col].apply(lambda x: list(set(x))) - - easyview = easyview.sort_values(by=["reputation_status", "filename"]) + if col in ["reputation_status", "filename"]: + # Sort the list to ensure consistent first item + easyview[col] = easyview[col].apply(lambda x: sorted(x)[0] if x else None) ct.style_dataframe_dark(easyview, f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.html") ct.style_dataframe_dark(pathexclusions, f"preflight\\final_path_exclusions_{first_policy}_{second_policy}.html")