JackieTien97 opened a new pull request, #17715:
URL: https://github.com/apache/iotdb/pull/17715

   ## Summary
   
   - Catch `NotImplementedError` in `convert_to_timestamp` (fall back to naive 
Timestamp) and `isoformat` (build ISO 8601 string from components).
   - Unblocks the Python client CI which has been red on master since 
2026-05-06.
   
   ## Root cause
   
   `pandas==3.0.3` (released early May 2026) restricts `Timestamp.toordinal()` 
to year range 1..9999, and Python 3.14's `datetime.isoformat` calls it 
internally. Several integration tests insert `9223372036854775807` 
(Long.MAX_VALUE) into TIMESTAMP fields; reading back yields year 292,278,994, 
and `print(row_record)` then crashes with:
   
   ```
   NotImplementedError: toordinal not yet supported on Timestamps which are
   outside the range of Python's standard library.
   ```
   
   `tz`-aware Timestamps in that range crash even harder — `utcoffset()` itself 
raises `NotImplementedError` for zones like `Etc/UTC`/`Asia/Shanghai`, so just 
catching the error in `isoformat` isn't enough.
   
   The failure is not caused by #17696 — that PR only inherits the existing 
master failure.
   
   ## Fix
   
   | Function | Change |
   |---|---|
   | `convert_to_timestamp` | Catch `NotImplementedError`, return a naive 
Timestamp. |
   | `isoformat` | Catch `NotImplementedError`, format via new 
`_isoformat_from_components` helper. |
   | `_isoformat_from_components` | Build `YYYY-MM-DDTHH:MM:SS.fff` from 
`.year/.month/.day/...`, append UTC offset when available; omit it when 
`utcoffset()` also fails. |
   
   Verified locally on Python 3.13.2 and 3.14.4 (pandas 3.0.3) against every 
boundary value the failing tests use (Long.MIN/MAX, int32 boundaries, 0, ±1) × 
ms/us/ns × UTC/Etc/UTC/Asia/Shanghai/America/Los_Angeles → 0 failures.
   
   ## Test plan
   
   - [ ] CI `python (3.x)` job passes against this PR.
   - [ ] Existing test assertions still match (none depended on the previously 
crashing format).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to