even MORE code review
stateful to not deadhang, graph context -> output, more explicit state errors, other misc changes idfk any of those good thing theyre fixed tho
This commit is contained in:
@@ -363,8 +363,10 @@ def _state_write_from_metadata(raw: object) -> StateWrite:
|
||||
visible_value=visible_value,
|
||||
reducer=ReducerRef.model_validate(reducer),
|
||||
)
|
||||
except Exception as exc:
|
||||
raise WorkflowExecutionError("malformed pending foreach write") from exc
|
||||
except WorkflowExecutionError:
|
||||
raise
|
||||
except (TypeError, ValueError) as exc:
|
||||
raise WorkflowExecutionError(f"malformed pending foreach write: {exc}") from exc
|
||||
|
||||
|
||||
def _state_write_to_metadata(write: StateWrite) -> dict[str, Any]:
|
||||
|
||||
@@ -216,7 +216,13 @@ def _lineage_chain(
|
||||
) -> Iterator[LineageState]:
|
||||
lineage = _lineage(run, scope_id=scope_id, lineage_id=lineage_id)
|
||||
reverse_chain: list[LineageState] = []
|
||||
seen: set[str] = set()
|
||||
while True:
|
||||
if lineage.id in seen:
|
||||
raise WorkflowExecutionError(
|
||||
f"cycle detected in lineage chain at {lineage.id!r}"
|
||||
)
|
||||
seen.add(lineage.id)
|
||||
reverse_chain.append(lineage)
|
||||
if lineage.parent_id is None:
|
||||
break
|
||||
|
||||
@@ -253,6 +253,7 @@ def _finish_subgraph(
|
||||
prepared.workflow,
|
||||
child_scope.committed_state,
|
||||
workflow_input=child_scope.workflow_input,
|
||||
context=frame_context_values(child_frame),
|
||||
)
|
||||
validate_payload_against_schema(
|
||||
prepared.workflow.output_schema,
|
||||
|
||||
Reference in New Issue
Block a user