Skip to content

Commit

Permalink
Add a simple test for showing missing ChunkedArray Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed Feb 13, 2024
1 parent d9fb6b9 commit 34f0714
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions xarray/tests/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from xarray.core.types import T_DuckArray
from xarray.core.utils import NDArrayMixin
from xarray.core.variable import as_compatible_data, as_variable
from xarray.namedarray.pycompat import array_type
from xarray.namedarray.pycompat import array_type, is_chunked_array
from xarray.tests import (
assert_allclose,
assert_array_equal,
Expand Down Expand Up @@ -2732,9 +2732,17 @@ def __init__(self, array):
def chunks(self):
return self.shape

def __array_function__(self, *args, **kwargs):
return NotImplemented

def __array_ufunc__(self, *args, **kwargs):
return NotImplemented


array = CustomArray(np.arange(3))
orig = Variable(dims=("x"), data=array, attrs={"foo": "bar"})
assert isinstance(orig._data, np.ndarray) # should not be CustomArray
assert is_chunked_array(array)
var = Variable(dims=("x"), data=array)
var.load()

def test_raise_no_warning_for_nan_in_binary_ops():
with assert_no_warnings():
Expand Down

0 comments on commit 34f0714

Please sign in to comment.