Skip to content

Commit

Permalink
Update postgres.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyaspimpalgaonkar authored Oct 23, 2024
1 parent 587a2f9 commit 08b07d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py/core/providers/kg/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ async def get_community_details(
) -> Tuple[int, List[Dict[str, Any]], List[Dict[str, Any]]]:

QUERY = f"""
SELECT level FROM {self._get_table_name("community")} WHERE cluster = $1 AND collection_id = $2
SELECT level FROM {self._get_table_name("community_info")} WHERE cluster = $1 AND collection_id = $2
LIMIT 1
"""
level = (
Expand All @@ -770,7 +770,7 @@ async def get_community_details(
QUERY = f"""
WITH node_triple_ids AS (
SELECT node, triple_ids
FROM {self._get_table_name("community")}
FROM {self._get_table_name("community_info")}
WHERE cluster = $1 AND collection_id = $2
)
SELECT DISTINCT
Expand Down Expand Up @@ -871,7 +871,7 @@ async def delete_graph_for_collection(
)

for query in DELETE_QUERIES:
if "community" in query or "entity_collection" in query:
if "community" in query or "collection_entity" in query:
await self.execute_query(query, [collection_id])
else:
await self.execute_query(query, [document_ids])
Expand Down

0 comments on commit 08b07d7

Please sign in to comment.