File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -2917,11 +2917,9 @@ def _dt_to_pytimedelta(self) -> np.ndarray:
29172917 return np .array (data , dtype = object )
29182918
29192919 def _dt_total_seconds (self ) -> Self :
2920- # Convert duration to seconds using PyArrow compute
29212920 unit = self ._pa_array .type .unit
2922- unit_to_seconds = {"s" : 1.0 , "ms" : 1e-3 , "us" : 1e-6 , "ns" : 1e-9 }
2923- factor = unit_to_seconds [unit ]
2924- result = pc .multiply (pc .cast (self ._pa_array , pa .int64 ()), factor )
2921+ unit_per_second = {"s" : 1 , "ms" : 1000 , "us" : 1_000_000 , "ns" : 1_000_000_000 }
2922+ result = pc .divide (pc .cast (self ._pa_array , pa .int64 ()), unit_per_second [unit ])
29252923 return self ._from_pyarrow_array (result )
29262924
29272925 def _dt_as_unit (self , unit : str ) -> Self :
You can’t perform that action at this time.
0 commit comments