From daec70db65542a6fd7ae473b3bd9c294fbdefb03 Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Mon, 30 Jun 2025 12:55:05 -0700 Subject: [PATCH] fix falkordb linting issues (#650) Refactor FalkorDB driver: change port type to int and clean up whitespace --- graphiti_core/driver/falkordb_driver.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graphiti_core/driver/falkordb_driver.py b/graphiti_core/driver/falkordb_driver.py index 1ff50b3e..2c48444a 100644 --- a/graphiti_core/driver/falkordb_driver.py +++ b/graphiti_core/driver/falkordb_driver.py @@ -66,7 +66,7 @@ class FalkorDriver(GraphDriver): def __init__( self, host: str = 'localhost', - port: str = '6379', + port: int = 6379, username: str | None = None, password: str | None = None, falkor_db: FalkorDB | None = None, @@ -74,8 +74,8 @@ class FalkorDriver(GraphDriver): """ Initialize the FalkorDB driver. - FalkorDB is a multi-tenant graph database. - To connect, provide the host and port. + FalkorDB is a multi-tenant graph database. + To connect, provide the host and port. The default parameters assume a local (on-premises) FalkorDB instance. """ super().__init__() @@ -110,7 +110,7 @@ class FalkorDriver(GraphDriver): # Convert the result header to a list of strings header = [h[1] for h in result.header] - + # Convert FalkorDB's result format (list of lists) to the format expected by Graphiti (list of dicts) records = [] for row in result.result_set: @@ -122,7 +122,7 @@ class FalkorDriver(GraphDriver): # If there are more fields in header than values in row, set to None record[field_name] = None records.append(record) - + return records, header, None def session(self, database: str | None) -> GraphDriverSession: @@ -131,7 +131,7 @@ class FalkorDriver(GraphDriver): async def close(self) -> None: """Close the driver connection.""" if hasattr(self.client, 'aclose'): - await self.client.aclose() + await self.client.aclose() # type: ignore[reportUnknownMemberType] elif hasattr(self.client.connection, 'aclose'): await self.client.connection.aclose() elif hasattr(self.client.connection, 'close'):