From b56a1dee5971968eda0e1623b3a285507ee71aa0 Mon Sep 17 00:00:00 2001 From: Igor Ilic Date: Thu, 28 Nov 2024 20:22:55 +0100 Subject: [PATCH] refactor: formatting fix for PR Fixed formatting for files in pull request Refactor COG-678 --- .../relational/sqlalchemy/SqlAlchemyAdapter.py | 2 +- .../vector/pgvector/create_db_and_tables.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py b/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py index 9891b900c..a5733967e 100644 --- a/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py +++ b/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py @@ -188,7 +188,7 @@ class SQLAlchemyAdapter(): result = await session.execute(query) # Fetch all rows as a list of dictionaries - rows = result.mappings().all() # Use `.mappings()` to get key-value pairs + rows = result.mappings().all() return rows async def execute_query(self, query): diff --git a/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py b/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py index 5da3ec968..a01d368e0 100644 --- a/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py +++ b/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py @@ -6,15 +6,15 @@ from sqlalchemy import text created=False async def create_db_and_tables(): - vector_config = get_vectordb_config() - vector_engine = get_vector_engine() + vector_config = get_vectordb_config() + vector_engine = get_vector_engine() - if vector_config.vector_db_provider == "pgvector": - global created - if not created: - await vector_engine.create_database() - created = True + if vector_config.vector_db_provider == "pgvector": + global created + if not created: + await vector_engine.create_database() + created = True - async with vector_engine.engine.begin() as connection: - await connection.execute(text("CREATE EXTENSION IF NOT EXISTS vector;")) + async with vector_engine.engine.begin() as connection: + await connection.execute(text("CREATE EXTENSION IF NOT EXISTS vector;"))