mucahitkantepe commited on
Commit
29d4bd7
·
1 Parent(s): 0035f43

health: report taste_embedding population count

Browse files
Files changed (1) hide show
  1. backend/app/main.py +6 -0
backend/app/main.py CHANGED
@@ -44,10 +44,16 @@ def health():
44
  store = deps.get_store()
45
  total = store.conn.execute("SELECT COUNT(*) FROM products").fetchone()[0]
46
  cols = [r[1] for r in store.conn.execute("PRAGMA table_info(products)").fetchall()]
 
 
 
 
 
47
  return {
48
  "status": "ok",
49
  "db_path": str(store.db_path),
50
  "total_products": total,
 
51
  "columns": cols,
52
  "data_dir": os.environ.get("TASTE_DATA_DIR", "not set"),
53
  }
 
44
  store = deps.get_store()
45
  total = store.conn.execute("SELECT COUNT(*) FROM products").fetchone()[0]
46
  cols = [r[1] for r in store.conn.execute("PRAGMA table_info(products)").fetchall()]
47
+ embeds = 0
48
+ if "taste_embedding" in cols:
49
+ embeds = store.conn.execute(
50
+ "SELECT COUNT(*) FROM products WHERE taste_embedding IS NOT NULL"
51
+ ).fetchone()[0]
52
  return {
53
  "status": "ok",
54
  "db_path": str(store.db_path),
55
  "total_products": total,
56
+ "with_taste_embedding": embeds,
57
  "columns": cols,
58
  "data_dir": os.environ.get("TASTE_DATA_DIR", "not set"),
59
  }