Skip to content

Commit 6115dd8

Browse files
committed
xfail
1 parent 3f7670b commit 6115dd8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

xarray/core/duck_array_ops.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ def as_shared_dtype(scalars_or_arrays, xp=np):
230230
arrays = [asarray(x, xp=cp) for x in scalars_or_arrays]
231231
else:
232232
arrays = [
233+
# https://github.com/pydata/xarray/issues/8402
234+
# https://github.com/pydata/xarray/issues/7721
233235
x if isinstance(x, (int, float, complex)) else asarray(x, xp=xp)
234236
for x in scalars_or_arrays
235237
]

xarray/tests/test_array_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def test_unstack(arrays: tuple[xr.DataArray, xr.DataArray]) -> None:
146146
assert_equal(actual, expected)
147147

148148

149+
@pytest.mark.xfail(
150+
reason="We don't know how to handle python scalars with array API arrays. This is strictly prohibited by the array API"
151+
)
149152
def test_where() -> None:
150153
np_arr = xr.DataArray(np.array([1, 0]), dims="x")
151154
xp_arr = xr.DataArray(xp.asarray([1, 0]), dims="x")

0 commit comments

Comments
 (0)