Repository navigation
Fix out-of-range Python timestamps with pandas 3.1 - #19248
Merged
jt2594838 merged 3 commits intoNov 13, 2026
Merged
Conversation
Caideyipi
reviewed
Nov 12, 2026
| ts = pd.Timestamp(time, unit=precision).tz_localize(timezone) | ||
| except NotImplementedError: | ||
| return pd.Timestamp(time, unit=precision) | ||
| ts = ( |
Collaborator
There was a problem hiding this comment.
[P2] Keep focused regression coverage in the final diff
The second commit removes tests/unit/test_rpc_utils.py, so this overflow path has no regression test in the PR. Please retain at least a compact test for extreme millisecond values under pandas 3.1, including a non-UTC timezone and signed-boundary values; the current Python CI can pass without exercising the inputs that triggered this failure.
jt2594838
approved these changes
Nov 13, 2026
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.
Problem
Python client CI with pandas 3.1.1 fails when reading extreme TIMESTAMP values in both tree and table models. For example,
9223372036854775807milliseconds raisesOutOfBoundsDatetimeinconvert_to_timestamp(), and the fallback repeats the same failing numeric constructor. This affects Field formatting and query results converted to a DataFrame.pandas 3.1 defaults numeric datetime input to microsecond resolution, so rescaling extreme millisecond values overflows.
Change
Construct fallback timestamps from a NumPy datetime64 scalar at the original precision, preserving the exact integer epoch value. Convert timezones from UTC and retain the existing naive-timestamp fallback when timezone conversion cannot represent the date. The normal conversion path is unchanged.
Before: the maximum millisecond value raises
OutOfBoundsDatetime. After: it remains exactly9223372036854775807milliseconds and can be formatted as292278994-08-17T07:12:55.807when the naive fallback is required.The diff only changes
rpc_utils.py; no dependency pinning or server changes.Regression coverage
A compact parameterized test covers
-9223372036854775807and9223372036854775807milliseconds with UTC and Asia/Shanghai timezones. It asserts the exact integer epoch value after conversion, catching overflow and timezone-induced shifts. The minimum int64 value itself is reserved for NaT.Validation
python -m pytest tests/unit -q: 54 passed on pandas 3.1.1 (Python 3.11.14).python -m pytest tests/unit/test_rpc_utils.py -q: 4 passed on pandas 2.2.3 (Python 3.12.3).git diff --check: passed.test_insert_use_tabletintegration test and a full Python suite with the earlier, larger regression set passed (152 tests). The full integration suite was not rerun for this test-only update.Local integration validation reused the existing Apache IoTDB
iotdb:devDocker image. Local Python versions differ from CI's Python 3.15.2; that runtime is covered by remote CI.