Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/orcapod/pipeline/loaded_side_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ def run(self, *, load_only: bool = False) -> StreamView:
run_job_node(
self,
load_only=True,
run_alone=lambda: self._run_alone(load_only=True),
# As the live node: a run alone has no use for the unchecked source ids.
run_alone=lambda _unchecked: self._run_alone(load_only=True),
caller=sys._getframe(1), # pyright: ignore[reportPrivateUsage] # the caller's line is where a failure warning is shown
)
return self._with_run_status(self._view_of_rows(self.as_table(), "held"))
11 changes: 11 additions & 0 deletions superpowers/plans/hotfix-loaded-side-effect-run-alone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Hotfix: loaded side-effect node passes run_alone the unchecked source ids

Cause: #384 (ITL-1102) made `run_job_node`'s `run_alone` take the unchecked source ids; #381
(ITL-1094) `LoadedSideEffectJobNode.run` still passes a zero-argument lambda (basedpyright error,
TypeError if reached).

Plan:
1. Failing test: a `LoadedSideEffectJobNode` over a non-job stream (an `ArrowTableSource`
stream) runs `run(load_only=True)`; this reaches `run_alone`.
2. Fix: `lambda _unchecked: ...`, as the live `SideEffectJobNode.run` does (the ids are unused).
3. basedpyright, ruff, targeted tests, changelog check; PR.
20 changes: 20 additions & 0 deletions tests/test_pipeline/loaded_job/test_loaded_side_effect_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,23 @@ def deliver(ctx: Any, x: int) -> None:
loaded = Pipeline.load(blueprint)
with pytest.raises(RuntimeError, match="SideEffectNode.*no live side-effect pod"):
_ = loaded.to_invocations()


def test_a_loaded_side_effect_node_over_a_non_job_stream_runs_load_only(
saved: tuple[PipelineJob, list[int], pathlib.Path],
) -> None:
"""A load-only run reaches ``run_alone`` when no job node feeds the node.

``PipelineJob.load`` always puts a job node upstream, so the node is built directly
over a source's stream (#381 x #384: ``run_alone`` takes the unchecked source ids).
"""
from orcapod.pipeline.loaded_side_effects import LoadedSideEffectJobNode

_, sent, path = saved
delivered_before = list(sent)
descriptor = _descriptors(path)["delivered"]
node = LoadedSideEffectJobNode(descriptor, _source()) # pyright: ignore[reportArgumentType] # a source is a stream
view = node.run(load_only=True)
assert view.status is ViewStatus.LOADED_ONLY
assert view.as_table().num_rows == ROWS
assert sent == delivered_before
Loading