hisham-cmd commited on
Commit
61e4ee7
·
verified ·
1 Parent(s): aecee3e

Delete diag_counts.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. diag_counts.py +0 -26
diag_counts.py DELETED
@@ -1,26 +0,0 @@
1
- import json
2
- import os
3
- import sys
4
- sys.path.append(os.getcwd())
5
- from sqlalchemy import create_engine
6
- from app.db.base import settings
7
- from app.models.product import Product, Category
8
-
9
- # 1. Count in JSON
10
- json_path = r'c:\react_projects\VortexCommerce\kaggle\extra_products_vortex.json'
11
- with open(json_path, "r", encoding="utf-8") as f:
12
- data = json.load(f)
13
- json_count = len(data["products"]) if isinstance(data, dict) else len(data)
14
- print(f"JSON Product Count: {json_count}")
15
-
16
- # 2. Count in DB
17
- db_url = settings.DATABASE_URL.replace(":5432/", ":6543/")
18
- engine = create_engine(db_url)
19
- from sqlalchemy.orm import sessionmaker
20
- SessionLocal = sessionmaker(bind=engine)
21
- db = SessionLocal()
22
- db_count = db.query(Product).count()
23
- cat_count = db.query(Category).count()
24
- print(f"DB Product Count: {db_count}")
25
- print(f"DB Category Count: {cat_count}")
26
- db.close()