Skip to content

FIX: support RangeIndex inputs in auto-formatting#391

Open
biru-codeastromer wants to merge 1 commit intosktime:mainfrom
biru-codeastromer:fix/auto-format-rangeindex-support
Open

FIX: support RangeIndex inputs in auto-formatting#391
biru-codeastromer wants to merge 1 commit intosktime:mainfrom
biru-codeastromer:fix/auto-format-rangeindex-support

Conversation

@biru-codeastromer
Copy link
Copy Markdown
Contributor

Summary

This fixes an internal auto-format failure for valid integer-indexed / RangeIndex time series.

Closes #390.

Problem

load_data_source accepts integer-indexed pandas data, but the auto-format path assumes every index exposes datetime-like frequency metadata. With RangeIndex, that raised an internal AttributeError on index.freq, logged a warning, and fell back to the unformatted path.

Changes

  • guard frequency inspection so it only runs for datetime / period indexes
  • preserve the existing Integer frequency metadata for non-datetime indexes
  • add a regression test covering the integer-indexed pandas load path with auto-format enabled

Verification

  • .venv/bin/ruff check src/sktime_mcp/runtime/executor.py tests/test_data_sources.py
  • .venv/bin/ruff format --check src/sktime_mcp/runtime/executor.py tests/test_data_sources.py
  • .venv/bin/pytest tests/test_data_sources.py -q
  • .venv/bin/pytest -q

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] auto_format_on_load crashes internally for valid RangeIndex time series

1 participant