Skip to content

Commit

Permalink
Simplify fast path
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed May 5, 2024
1 parent 2129be5 commit 4c6ce2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xarray/core/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ 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))
ndim = getattr(data, "ndim", None)
if fastpath and ndim is not None:
return data

from xarray.core.dataarray import DataArray

Expand Down

0 comments on commit 4c6ce2f

Please sign in to comment.