Skip to content

Commit 93a0690

Browse files
committed
Fixes
1 parent 13f08c1 commit 93a0690

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

examples/benchmark_real_pipeline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
import time
2424
from pathlib import Path
2525
from typing import List
26+
from dotenv import load_dotenv
27+
28+
load_dotenv()
2629

2730
from neo4j_graphrag.experimental.pipeline.config.runner import PipelineRunner
2831
from neo4j_graphrag.experimental.pipeline.executors import LocalExecutor, RayExecutor

src/neo4j_graphrag/experimental/pipeline/executors.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,20 @@ async def submit(
112112

113113
import cloudpickle
114114

115-
task_bytes = cloudpickle.dumps(task)
115+
try:
116+
task_bytes = cloudpickle.dumps(task)
117+
except Exception as exc: # noqa: BLE001
118+
# Component (e.g., holding Neo4j driver) is not picklable – run locally.
119+
# This keeps the pipeline working even if some tasks cannot be off-loaded.
120+
import logging
121+
122+
logging.getLogger(__name__).warning(
123+
"RayExecutor fallback to LocalExecutor for %s: %s", task.name, exc
124+
)
125+
return await super().submit(task, context, inputs)
126+
116127
obj_ref = self._remote_runner.remote(task_bytes, inputs)
117-
res = await self._ray.get(obj_ref)
128+
res = self._ray.get(obj_ref)
118129
if res is None:
119130
return None
120131
return RunResult(result=res)

0 commit comments

Comments
 (0)