Skip to content

Commit a2bb9d8

Browse files
committed
Simplify fast path
1 parent 8d728bf commit a2bb9d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

xarray/core/variable.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,8 @@ def as_compatible_data(
269269
270270
Finally, wrap it up with an adapter if necessary.
271271
"""
272-
if fastpath and getattr(data, "ndim", 0) > 0:
273-
# can't use fastpath (yet) for scalars
274-
return cast("T_DuckArray", _maybe_wrap_data(data))
272+
if fastpath and getattr(data, "ndim", None) is not None:
273+
return cast("T_DuckArray", data)
275274

276275
from xarray.core.dataarray import DataArray
277276

0 commit comments

Comments
 (0)