diff --git a/py/core/providers/kg/postgres.py b/py/core/providers/kg/postgres.py index 8a10f59fc..d32a805d4 100644 --- a/py/core/providers/kg/postgres.py +++ b/py/core/providers/kg/postgres.py @@ -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 = ( @@ -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 @@ -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])