Skip to content

Commit

Permalink
Simplify fast path (#9001)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk authored and andersy005 committed May 10, 2024
1 parent c4c2fbd commit bce79d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions xarray/core/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,8 @@ def as_compatible_data(
Finally, wrap it up with an adapter if necessary.
"""
if fastpath and getattr(data, "ndim", 0) > 0:
# can't use fastpath (yet) for scalars
return cast("T_DuckArray", _maybe_wrap_data(data))
if fastpath and getattr(data, "ndim", None) is not None:
return cast("T_DuckArray", data)

from xarray.core.dataarray import DataArray

Expand Down

0 comments on commit bce79d5

Please sign in to comment.