Skip to content

Fix pipeline mutation in historical forecasts - #3312

Merged
dennisbader merged 3 commits into
unit8co:masterfrom
Pallav-Biyala:fix/historical-forecasts-pipeline-copy
Oct 28, 2026
Merged

dennisbader merged 3 commits into
unit8co:masterfrom
Pallav-Biyala:fix/historical-forecasts-pipeline-copy

Conversation

@Pallav-Biyala

@Pallav-Biyala Pallav-Biyala commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3308

Summary

  • Fixes an issue where historical_forecasts() could mutate caller-provided Pipeline instances when copy=True.
  • Deep-copies existing Pipeline instances in _convert_data_transformers() when copying is enabled, while preserving the existing behavior when copy=False.
  • Adds a regression test verifying that the original pipeline remains unfitted after historical_forecasts() runs.
  • Adds a changelog entry under Unreleased.

Other Information

Tests and checks performed:

  • Historical forecasts tests: 1367 passed, 197 skipped.
  • Pipeline tests: 20 passed.
  • Ruff lint checks passed.
  • Ruff formatting checks passed.
  • git diff --check passed.

No failures were observed in the tests listed above.

AI assistance: OpenAI ChatGPT and Google Gemini were used to assist with code investigation, implementation, regression-test development, and debugging. I reviewed the generated changes, identified failures in previously generated test cases, and corrected them. I also ran the relevant test suites and code-quality checks.

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.14%. Comparing base (df61e74) to head (b456bfd).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3312      +/-   ##
==========================================
+ Coverage   97.13%   97.14%   +0.01%     
==========================================
  Files         175      175              
  Lines       19423    19429       +6     
==========================================
+ Hits        18867    18875       +8     
+ Misses        556      554       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dennisbader dennisbader left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot for the PR and the quick fix @Pallav-Biyala 🚀

LGTM 💯

@dennisbader
dennisbader merged commit 0880bff into unit8co:master Oct 28, 2026
10 checks passed
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.

historical_forecasts(retrain=True) mutates Pipeline instances in data_transformers in-place

2 participants