MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / get_table_counts

Function get_table_counts

scripts/clear_database.py:64–73  ·  view source on GitHub ↗

Return row counts for the main tables.

(conn: sqlite3.Connection)

Source from the content-addressed store, hash-verified

62
63
64def get_table_counts(conn: sqlite3.Connection) -> Dict[str, int]:
65 """Return row counts for the main tables."""
66 counts: Dict[str, int] = {}
67 cursor = conn.cursor()
68
69 for table_name in ("profiles", "papers", "behavior_logs", "task_status"):
70 cursor.execute(f"SELECT COUNT(*) FROM {table_name}")
71 counts[table_name] = int(cursor.fetchone()[0])
72
73 return counts
74
75
76def _prune_redundant_directions(direction_weights: Dict[str, float]) -> Dict[str, float]:

Callers 2

full_resetFunction · 0.85
benchmark_resetFunction · 0.85

Calls 2

cursorMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected