Skip to content

Commit 658ca8f

Browse files
committed
fix: improve parameter validation in pipeline steps and correct error message
1 parent 3d9891f commit 658ca8f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ai_agent/pipeline_agent.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,12 @@ def validate_pipeline(pipeline_def: dict, registry: dict) -> tuple[list[str], li
128128
for i, step in enumerate(pipeline["steps"]):
129129
step_id = step.get("id", f"step_{i}")
130130

131-
params = step.get("params") or {}
132-
if not isinstance(params, dict):
133-
errors.append(f"Step '{step_id}': 'params' must be an object/dict")
131+
if "params" in step:
132+
params = step.get("params")
133+
if not isinstance(params, dict):
134+
errors.append(f"Step '{step_id}': 'params' must be an object/dict")
135+
params = {}
136+
else:
134137
params = {}
135138

136139
if step_id in step_ids:
@@ -178,7 +181,7 @@ def validate_pipeline(pipeline_def: dict, registry: dict) -> tuple[list[str], li
178181
if svc_type == "extract" and depends_on:
179182
errors.append(f"Step '{step_id}': extract steps must not have depends_on")
180183
if svc_type != "extract" and not depends_on:
181-
errors.append(f"Step '{step_id}': non-extract steps require depends_on")
184+
errors.append(f"Step '{step_id}': non-extract steps requires depends_on")
182185
if service == "join_datasets" and len(depends_on) != 2:
183186
errors.append(f"Step '{step_id}': join_datasets requires exactly 2 depends_on entries")
184187
if service != "join_datasets" and len(depends_on) > 1:

0 commit comments

Comments
 (0)