Skip to content

[BUG] FIXED: Potential sequence length bug in preprocessed record (Obvious but Critical)#2266

Open
Chetansahney wants to merge 2 commits into
sktime:mainfrom
Chetansahney:fix/potential-seq-length
Open

[BUG] FIXED: Potential sequence length bug in preprocessed record (Obvious but Critical)#2266
Chetansahney wants to merge 2 commits into
sktime:mainfrom
Chetansahney:fix/potential-seq-length

Conversation

@Chetansahney
Copy link
Copy Markdown

Reference Issues/PRs

Fixes #2265

What does this implement/fix? Explain your changes.

This PR fixes sequence-length metadata in tslib preprocessing.
_preprocess_data() was using len(series) (number of keys in the record) instead of the true time dimension length.
It now sets length from the timestep/sequence length, so downstream logic receives correct series length metadata.

What should a reviewer concentrate their feedback on?

  • Correctness of the length calculation change in _preprocess_data()
  • Any downstream assumptions that depend on processed["length"]
  • Backward compatibility for existing tslib data flows

Did you add any tests for the change?

Yes. Added/updated a regression assertion in test_preprocess_data to verify processed["length"] == len(original_sample["t"]).

Any other comments?

This is a targeted bugfix with minimal surface-area changes.

PR checklist

  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
  • Added/modified tests
  • Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with pre-commit install. To run hooks independent of commit, execute pre-commit run --all-files

@Chetansahney Chetansahney changed the title [BUG] FIXED: Potential sequence length bug in preprocessed record [BUG] FIXED: Potential sequence length bug in preprocessed record (Obvious but Critical) Apr 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@818a84d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...h_forecasting/data/tests/test_tslib_data_module.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2266   +/-   ##
=======================================
  Coverage        ?   86.92%           
=======================================
  Files           ?      166           
  Lines           ?     9766           
  Branches        ?        0           
=======================================
  Hits            ?     8489           
  Misses          ?     1277           
  Partials        ?        0           
Flag Coverage Δ
cpu 86.92% <0.00%> (?)
pytest 86.92% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@Chetansahney
Copy link
Copy Markdown
Author

Hi @christy @rustyconover @szepeviktor @TKlerx .
Am looking forward for your reviews :)

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.

[BUG] Potential sequence length bug in preprocessed record

1 participant