diff --git a/src/blosc2/lazyexpr.py b/src/blosc2/lazyexpr.py index 8dd188e1..5cbb0451 100644 --- a/src/blosc2/lazyexpr.py +++ b/src/blosc2/lazyexpr.py @@ -2014,7 +2014,6 @@ def _open_lazyarray(array): if isinstance(expr, blosc2.LazyExpr): # Make the array info available for the user (only available when opened from disk) expr.array = array - expr.schunk = array.schunk elif isinstance(expr, np.ndarray): # The expression was evaluated immediately expr = blosc2.asarray(expr) diff --git a/tests/ndarray/test_lazyexpr.py b/tests/ndarray/test_lazyexpr.py index f26c2421..63825a03 100644 --- a/tests/ndarray/test_lazyexpr.py +++ b/tests/ndarray/test_lazyexpr.py @@ -503,6 +503,11 @@ def test_save(): np.testing.assert_allclose(res[:], nres, rtol=tol, atol=tol) expr = blosc2.open(urlpath_save) + # After opening, check that a lazy expression does have an array attribute, + # but does not have a schunk one. This is by design, and because some packages + # (e.g. Caterva2), might assume that a LazyExpr does not have a schunk attribute. + assert hasattr(expr, "array") is True + assert hasattr(expr, "schunk") is False # Check the dtype (should be upcasted to float64) assert expr.array.dtype == np.float64 res = expr.compute()