Spaces:
Running
Running
File size: 993 Bytes
4b3a33f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import os
from supabase import create_client, Client
from dotenv import load_dotenv
load_dotenv()
url = os.environ.get("SUPABASE_URL")
key = os.environ.get("SUPABASE_SERVICE_ROLE_KEY") or os.environ.get("SUPABASE_KEY")
client: Client = create_client(url, key)
def check_clustering_status():
print("Checking profiles table for cluster labels...")
resp = client.table("profiles").select("id, cluster_label").limit(20).execute()
data = resp.data
if not data:
print("No profiles found.")
return
# Count how many have labels
labeled = [d for d in data if d.get("cluster_label")]
print(f"Sample size: {len(data)}")
print(f"Profiles with cluster_label: {len(labeled)}")
if labeled:
print("Sample labels:")
for d in labeled[:5]:
print(f" - {d['id']}: {d['cluster_label']}")
else:
print("No profiles have cluster labels in this sample.")
if __name__ == "__main__":
check_clustering_status()
|