diff --git a/xarray/namedarray/core.py b/xarray/namedarray/core.py index c8ddb880ceb..d4bc5e67dca 100644 --- a/xarray/namedarray/core.py +++ b/xarray/namedarray/core.py @@ -520,9 +520,9 @@ def __le__(self, other: int | float | NamedArray, /): return less_equal(self, asarray(other)) def __lshift__(self, other: int | NamedArray, /): - from xarray.namedarray._array_api import bitwise_left_shift + from xarray.namedarray._array_api import bitwise_left_shift, asarray - return bitwise_left_shift(self) + return bitwise_left_shift(self, asarray(other)) def __lt__(self, other: int | float | NamedArray, /): from xarray.namedarray._array_api import asarray, less @@ -555,9 +555,9 @@ def __neg__(self, /): return negative(self) def __or__(self, other: int | bool | NamedArray, /): - from xarray.namedarray._array_api import bitwise_or + from xarray.namedarray._array_api import bitwise_or, asarray - return bitwise_or(self) + return bitwise_or(self, asarray(other)) def __pos__(self, /): from xarray.namedarray._array_api import positive @@ -570,9 +570,9 @@ def __pow__(self, other: int | float | NamedArray, /): return pow(self, asarray(other)) def __rshift__(self, other: int | NamedArray, /): - from xarray.namedarray._array_api import bitwise_right_shift + from xarray.namedarray._array_api import bitwise_right_shift, asarray - return bitwise_right_shift(self) + return bitwise_right_shift(self, asarray(other)) def __setitem__( self, @@ -597,9 +597,9 @@ def __truediv__(self, other: float | NamedArray, /): return divide(self, asarray(other)) def __xor__(self, other: int | bool | NamedArray, /): - from xarray.namedarray._array_api import bitwise_xor + from xarray.namedarray._array_api import bitwise_xor, asarray - return bitwise_xor(self) + return bitwise_xor(self, asarray(other)) def __iadd__(self, other: int | float | NamedArray, /): from xarray.namedarray._array_api import asarray