Conversation
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.
Issue #, if available:
No existing issue found for this timezone failure. The affected normalization helper is from #507; this is separate from the string-ID ordering fix in #470.
Description of changes:
predict_dfcurrently raisesTypeError: Cannot change data-type for array of referenceswhen the timestamp column is timezone-aware.Series.to_numpy()produces an object array for these timestamps, which cannot be viewed asint64.Read the ordering keys from
DatetimeIndex.asi8instead. The returned DataFrame keeps its original timezone, while sorting uses absolute time, including repeated local hours during a daylight-saving transition. This also retains integer comparisons for NumPy 1.x.The regression tests cover UTC, Asia/Shanghai and America/New_York; sorted and unsorted input; caller immutability; and actual CPU
predict_dfcalls across the New York DST fold, with and without future covariates.Validation on the same upstream base (
4dbf163c2734c089cdf7da2b86fde48862ff9c6f):python -m pytest test/test_df_utils.py test/test_chronos2.py -k preserves_timezone -q: 8 failures before, 8 passes after, using identical test files.OMP_NUM_THREADS=1 python -m pytest -q: 564 passed, 20 xfailed, with no deselected tests, including public model and dataset downloads.python -m mypy src testanduv build: passed.Environment: macOS arm64, Python 3.11.15, PyTorch 2.14.0, Transformers 5.17.0; primary suite used NumPy 2.4.6 and pandas 3.0.5. The suite emits its existing long-horizon warnings and a CloudFront deprecation warning. An additional Ruff 0.16.7 check reports the same 130 diagnostics on the unmodified base and patch, with no new diagnostics; no unrelated lint cleanup is included.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.