Skip to content

Commit 50f8726

Browse files
authored
Simplify fast path (#9001)
1 parent 8d728bf commit 50f8726

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

xarray/core/variable.py

Lines changed: 2 additions & 3 deletions
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)