Commit 396737f
committed
BUG: Fix inconsistent datetime types between calamine and openpyxl readers (#59186)
The calamine Excel reader was returning pd.Timestamp and pd.Timedelta
for datetime values in mixed-type columns, while openpyxl returns
standard library datetime.datetime and datetime.timedelta objects.
This change modifies the calamine reader to return standard library
datetime types, ensuring consistent behavior across Excel reader engines.
- Return datetime.datetime as-is instead of converting to pd.Timestamp
- Convert date objects to datetime to match openpyxl behavior
- Return datetime.timedelta as-is instead of converting to pd.Timedelta
- Remove unused pandas import
- Update test helper get_exp_unit() to reflect new consistent behavior1 parent 47fea80 commit 396737f
2 files changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
111 | | - | |
| 113 | + | |
| 114 | + | |
112 | 115 | | |
113 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 138 | + | |
144 | 139 | | |
145 | 140 | | |
146 | 141 | | |
| |||
0 commit comments