Skip to content

Commit a3d41df

Browse files
committed
Improve documentation of future changes
1 parent 52dfd7a commit a3d41df

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/neo4j_graphrag/experimental/pipeline/orchestrator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ async def run_task(self, task: TaskPipelineNode, data: dict[str, Any]) -> None:
8585
run_id=self.run_id,
8686
task_name=task.name,
8787
)
88-
context = RunContext(run_id=self.run_id, task_name=task.name, notifier=notifier)
88+
context = RunContext(
89+
run_id=self.run_id, task_name=task.name, _notifier=notifier
90+
)
8991
res = await task.run(context, inputs)
9092
await self.set_task_status(task.name, RunStatus.DONE)
9193
await self.event_notifier.notify_task_finished(self.run_id, task.name, res)

src/neo4j_graphrag/experimental/pipeline/types/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class RunContext(BaseModel):
2828

2929
run_id: str
3030
task_name: str
31-
notifier: Optional[TaskProgressCallbackProtocol] = None
31+
_notifier: Optional[TaskProgressCallbackProtocol] = None
3232

3333
model_config = ConfigDict(arbitrary_types_allowed=True)
3434

3535
async def notify(self, message: str, data: dict[str, Any]) -> None:
36-
if self.notifier:
37-
await self.notifier(message=message, data=data)
36+
if self._notifier:
37+
await self._notifier(message=message, data=data)

tests/unit/experimental/pipeline/test_component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async def test_component_run_with_context() -> None:
6868
c = ComponentMultiplyWithContext()
6969
notifier_mock = AsyncMock()
7070
result = await c.run_with_context(
71-
RunContext(run_id="run_id", task_name="task_name", notifier=notifier_mock),
71+
RunContext(run_id="run_id", task_name="task_name", _notifier=notifier_mock),
7272
number1=1,
7373
number2=2,
7474
)

0 commit comments

Comments
 (0)