Repository navigation
fix: accept DatetimeIndex timestamp inputs - #412
Open
Aliciawque wants to merge 1 commit into
Open
Aliciawque wants to merge 1 commit into
Aliciawque wants to merge 1 commit into
Conversation
Normalize DatetimeIndex to Series before calendar feature extraction, while preserving existing Series labels. Add offline regression coverage for calendar fields and single/batched predictor preprocessing. Developed and tested with AI assistance.
Aliciawque
marked this pull request as ready for review
October 22, 2026 05:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
predict_batchdocumentspd.DatetimeIndexas a supported timestamp input, butcalc_time_stampsalways uses the Series-only.dtaccessor. Passing apd.date_range(...)directly therefore raisesAttributeError: 'DatetimeIndex' object has no attribute 'dt'before generation.This narrowly converts DatetimeIndex inputs to a Series before extracting calendar fields. Existing Series inputs, including their row labels and order, are unchanged. No timezone conversion, timestamp sorting, model behavior, or input-validation policy is introduced.
Reproduction
This raises on base
67b630eand returns the five calendar-feature columns with this patch.Tests
python -m pytest -q tests/test_timestamp_inputs.py: 4 passed, 3 subtests passed.generateis mocked; these are not model-inference tests.python -m compileall -q model tests/test_timestamp_inputs.pyandgit diff --check: passed.Validation boundary
The full suite was attempted with Hugging Face offline mode. Its four pre-existing pretrained-model regression cases failed because the pinned model configurations/weights are not cached; the unmodified baseline reproduced the same four failures. No checkpoint downloads, GPU inference, forecasting-quality claims, or Windows/macOS verification.
Reviewed related PRs #335, #393, #404 and #410 to avoid duplicating their changes; none updates this timestamp helper.
Developed and tested with AI assistance. Ready for maintainer review; the validation boundaries above remain unchanged.