Skip to content

Commit

Permalink
New error message when saving invalid expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Oct 17, 2024
1 parent 4102f23 commit 0f966d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/blosc2/lazyexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1990,8 +1990,6 @@ def _new_expr(cls, expression, operands, guess, out=None, where=None):
print(f"shape: {new_expr.shape}, dtype: {new_expr.dtype}")
new_expr._shape = new_expr.shape
new_expr._dtype = new_expr.dtype
new_expr.expression = expression
new_expr.operands = operands
else:
# Create a new LazyExpr object
new_expr = cls(None)
Expand Down
2 changes: 1 addition & 1 deletion tests/ndarray/test_lazyexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def test_save_unsafe():
# during loading time (tested above).
with pytest.raises(Exception) as excinfo:
expr.save(urlpath=urlpath)
assert expr.expression in str(excinfo.value)
assert "invalid syntax" in str(excinfo.value)

for urlpath in disk_arrays:
blosc2.remove_urlpath(urlpath)
Expand Down

0 comments on commit 0f966d6

Please sign in to comment.