Skip to content

Commit

Permalink
First argument must be the function + ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
stellasia committed Jan 2, 2025
1 parent cf6662c commit d7ff762
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/neo4j_graphrag/experimental/pipeline/kg_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ async def run_async(
"""
return await self.runner.run({"file_path": file_path, "text": text})

def run(self, file_path: Optional[str] = None, text: Optional[str] = None) -> PipelineResult:
def run(
self, file_path: Optional[str] = None, text: Optional[str] = None
) -> PipelineResult:
"""Run pipeline synchronously"""
return run_sync(self, file_path=file_path, text=text)
return run_sync(self.run_async, file_path=file_path, text=text)
5 changes: 3 additions & 2 deletions src/neo4j_graphrag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# limitations under the License.
from __future__ import annotations

from functools import wraps
from typing import Optional
import asyncio
import concurrent.futures
from functools import wraps
from typing import Optional


def validate_search_query_input(
Expand All @@ -38,4 +38,5 @@ def async_to_sync(func):
@wraps(func)
def wrapper(*args, **kwargs):
return run_sync(func, *args, **kwargs)

return wrapper

0 comments on commit d7ff762

Please sign in to comment.