Skip to content

Commit f20b03d

Browse files
fangchenliclaude
andcommitted
CLN: combine nested casts in _dt_total_seconds
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent f9fa158 commit f20b03d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2920,8 +2920,8 @@ def _dt_total_seconds(self) -> Self:
29202920
unit = self._pa_array.type.unit
29212921
unit_to_seconds = {"s": 1.0, "ms": 1e-3, "us": 1e-6, "ns": 1e-9}
29222922
factor = unit_to_seconds[unit]
2923-
int_arr = pc.cast(self._pa_array, pa.int64())
2924-
result = pc.multiply(pc.cast(int_arr, pa.float64()), factor)
2923+
float_arr = pc.cast(pc.cast(self._pa_array, pa.int64()), pa.float64())
2924+
result = pc.multiply(float_arr, factor)
29252925
return self._from_pyarrow_array(result)
29262926

29272927
def _dt_as_unit(self, unit: str) -> Self:

0 commit comments

Comments
 (0)