Skip to content

feat: update examples/pipeline_2 to align with package better - #91

Merged
pikes-ons merged 2 commits into
developmentfrom
feat/example_2_upgrade
Sep 9, 2026
Merged

feat: update examples/pipeline_2 to align with package better #91
pikes-ons merged 2 commits into
developmentfrom
feat/example_2_upgrade

Conversation

@pikes-ons

Copy link
Copy Markdown
Collaborator

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.

…un_directory location searches. Also provides stage_results for use in demo

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.yaml to use output_dir: examples/pipeline_2/runs and remove hardcoded stage IO locations; remove pre-generated intermediate CSVs from data/.
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 calls main(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.

Comment thread examples/pipeline_2/scripts/0_clean_data.py Outdated
Comment thread examples/pipeline_2/scripts/1_derive_vars.py Outdated
Comment thread examples/pipeline_2/scripts/2_reporting.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread examples/pipeline_2/scripts/0_clean_data.py
Comment thread examples/pipeline_2/scripts/1_derive_vars.py
Comment thread examples/pipeline_2/scripts/2_reporting.py
@pikes-ons
pikes-ons merged commit 47ec17c into development Sep 9, 2026
9 checks passed
@pikes-ons
pikes-ons deleted the feat/example_2_upgrade branch September 9, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants