Skip to content

Commit dfe200d

Browse files
committed
Minor cleanup
1 parent 35ed378 commit dfe200d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

xarray/core/duck_array_ops.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,7 @@ def _timedelta_to_seconds(array):
523523

524524
def py_timedelta_to_float(array, datetime_unit):
525525
"""Convert a timedelta object to a float, possibly at a loss of resolution."""
526-
if not is_duck_array(array):
527-
array = np.asarray(array)
526+
array = asarray(array)
528527
if is_duck_dask_array(array):
529528
array = array.map_blocks(
530529
_timedelta_to_seconds, meta=np.array([], dtype=np.float64)

0 commit comments

Comments
 (0)