feat: update examples/pipeline_2 to align with package better - #91
Conversation
…un_directory location searches. Also provides stage_results for use in demo
There was a problem hiding this comment.
🟡 Changes recommended
The updated example stages now require an ExecutionContext but still allow/trigger context=None execution paths that will fail at runtime (including an explicit main(context=None) in 0_clean_data.py).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the examples/pipeline_2 example pipeline to rely on the package’s ExecutionContext for resolving input/output locations (run-directory based), and to return richer per-stage outputs (“stage_results”) rather than using fixed file paths.
Changes:
- Switch stage scripts to compute IO paths via
context(e.g.,resolve_output_root(),resolve_given_path()), aligning outputs with the pipeline run directory. - Add structured return dictionaries from stages (e.g., record counts, output locations, summary metrics).
- Update
conf.yamlto useoutput_dir: examples/pipeline_2/runsand remove hardcoded stage IO locations; remove pre-generated intermediate CSVs fromdata/.
File summaries
| File | Description |
|---|---|
| examples/pipeline_2/scripts/0_clean_data.py | Writes cleaned data into the run directory and returns stage outputs. |
| examples/pipeline_2/scripts/1_derive_vars.py | Reads prior-stage output via context resolution and writes derived dataset to the run directory with outputs returned. |
| examples/pipeline_2/scripts/2_reporting.py | Resolves prior-stage dataset via context and writes report into the run directory; returns summary outputs. |
| examples/pipeline_2/data/orders_prepped.csv | Removes committed intermediate output artifact. |
| examples/pipeline_2/data/orders_cleaned.csv | Removes committed intermediate output artifact. |
| examples/pipeline_2/conf.yaml | Updates output_dir to runs and removes per-stage input/output location entries. |
Review details
Suppressed comments (1)
examples/pipeline_2/scripts/0_clean_data.py:69
- The
__main__entrypoint explicitly callsmain(context=None), but this stage now requires an ExecutionContext; running the file directly will always fail. Prefer failing fast with a clear message (or wiring up a real context).
if __name__ == "__main__":
main(context=None)
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
The updated example stage entrypoints now require an ExecutionContext but still have direct-run invocation paths that will fail (TypeError/AttributeError) without a clearer handling of missing context.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Lite
Updated the example pipeline 2 code to account for correct logging and run_directory location searches. Also provides stage_results. This example should now be an idea example for how to run a Pipeline in this package with full utilisation.