process-aware-ai / backend /debug_data_fix.py
borndeveloper's picture
Deploy Process Aware AI Dashboard without binaries
b4a2e7f
Raw
History Blame Contribute Delete
1.5 kB
import sys
import os
# Ensure backend is in path
sys.path.append(os.getcwd())
try:
from app.services.data_service import data_service
print("Attempting to load data...")
data_service.load_data()
print("\n--- PO Types ---")
if data_service.po_type_df is not None:
print(f"Shape: {data_service.po_type_df.shape}")
print("Preview:")
print(data_service.po_type_df.head().to_string())
else:
print("FAIL: po_type_df is None")
print("\n--- Finish Descriptions ---")
if data_service.finish_df is not None:
print(f"Shape: {data_service.finish_df.shape}")
print("Preview:")
print(data_service.finish_df.head().to_string())
else:
print("FAIL: finish_df is None")
print("\n--- Shade Categories ---")
if data_service.master_df is not None:
if "Shade Type" in data_service.master_df.columns:
shades = data_service.master_df["Shade Type"].dropna().unique()
print(f"Found {len(shades)} shades.")
print(f"Sample: {shades[:10]}")
# Check for types
types = set(type(x) for x in shades)
print(f"Types found: {types}")
else:
print("FAIL: 'Shade Type' column not found in master_df.")
print(f"Columns: {data_service.master_df.columns.tolist()}")
else:
print("FAIL: master_df is None")
except Exception as e:
import traceback
traceback.print_exc()