Quality Check Fix

This commit is contained in:
2026-03-31 22:50:22 +01:00
parent 4b5b6cd1a4
commit 70bdd1639b
3 changed files with 53 additions and 2 deletions

View File

@@ -1487,6 +1487,33 @@ def main():
print("Building organizations summary...")
organizations_list = build_organizations(request_metas)
# === REPORT ORGANIZATION CENTER MAPPING ===
if mapping_dict:
unique_orgs = {} # org_normalized -> original org_name
for meta in request_metas:
org_name = meta.get("org_name")
if org_name:
unique_orgs[org_name.strip().lower()] = org_name
mapped_count = sum(1 for norm in unique_orgs if norm in mapping_dict)
unmapped_orgs = sorted(
name for norm, name in unique_orgs.items() if norm not in mapping_dict
)
mapping_summary = (
f"Organization center mapping: {mapped_count}/{len(unique_orgs)} organization(s) mapped."
)
console.print(f"[green]{mapping_summary}[/green]")
logging.info(mapping_summary)
if unmapped_orgs:
unmapped_header = f"{len(unmapped_orgs)} unmapped organization(s):"
console.print(f"[yellow]⚠ {unmapped_header}[/yellow]")
logging.warning(unmapped_header)
for org_name in unmapped_orgs:
console.print(f"[yellow] - {org_name}[/yellow]")
logging.warning(" - %s", org_name)
try:
# === QUALITY CHECKS ===
print()