Commit 90d8511
committed
Probe utcoffset() in convert_to_timestamp to catch deferred toordinal
The previous fix only handled NotImplementedError raised during
pd.Timestamp construction, but pandas 3.0 also defers the toordinal
crash to utcoffset() — which pd.DataFrame() calls when aligning a
mixed-tz column. test_query_data exercises this path via
result_set_to_pandas() → pd.DataFrame(...) and still failed.
Probe utcoffset() right after construction; if it raises
NotImplementedError, fall back to a naive Timestamp so the column
becomes datetime64[ms] (no tz) instead of datetime64[ms, <tz>]. NaT
short-circuits the probe (it doesn't support utcoffset()).
Verified: 0 failures across {ms,us,ns} × {UTC,Etc/UTC,Asia/Shanghai,
America/Los_Angeles} × Long.MIN/MAX/0/±1/Int32 boundaries on Python
3.13 and 3.14 with pandas 3.0.3, for both isoformat() and
pd.DataFrame() construction.1 parent f51011b commit 90d8511
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
99 | 110 | | |
100 | 111 | | |
101 | 112 | | |
| |||
0 commit comments