Skip to content

Commit

Permalink
fix: Making topic configurable in db info (#117)
Browse files Browse the repository at this point in the history
Closes #89
  • Loading branch information
tazarov authored Jan 20, 2025
1 parent 1fab88b commit 56b7d1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chroma_ops/db_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from rich.rule import Rule
from rich.table import Table

from chroma_ops.constants import DEFAULT_TENANT_ID, DEFAULT_TOPIC_NAMESPACE
from chroma_ops.utils import (
SqliteMode,
list_collections,
Expand All @@ -27,6 +28,8 @@ def info(
persist_dir: str,
skip_collection_names: Optional[Sequence[str]] = None,
privacy_mode: Optional[bool] = False,
tenant: Optional[str] = DEFAULT_TENANT_ID,
topic_namespace: Optional[str] = DEFAULT_TOPIC_NAMESPACE,
) -> Dict[str, Any]:
console = Console()
validate_chroma_persist_dir(persist_dir)
Expand Down Expand Up @@ -170,10 +173,9 @@ def info(
...
collection["segments"].append(segment)
# Get WAL entries per collection
topic = f"persistent://{tenant}/{topic_namespace}/{collection['id']}"
query = "SELECT count(*) FROM embeddings_queue WHERE topic = ?;"
cursor.execute(
query, [f"persistent://default/default/{collection['id']}"]
)
cursor.execute(query, [topic])
results = cursor.fetchall()
collection["wal_entries"] = results[0][0]
collection_data[cname] = collection
Expand Down

0 comments on commit 56b7d1b

Please sign in to comment.