@@ -747,7 +747,7 @@ def test_expr_no_operand(auth_client):
747
747
a = blosc2 .linspace (0 , 10 )
748
748
np .testing .assert_array_equal (a [:], c [:])
749
749
750
- # Check error when operand should be present but isnt
750
+ # Check error when operand should be present but isn't
751
751
opnm = "ds"
752
752
oppt = f"{ TEST_CATERVA2_ROOT } /ds-1d.b2nd"
753
753
expression = "ds + linspace(0, 10)"
@@ -758,9 +758,29 @@ def test_expr_no_operand(auth_client):
758
758
lxpath = auth_client .lazyexpr (lxname , expression )
759
759
760
760
761
- # User management
761
+ def test_expr_force_compute (auth_client ):
762
+ if not auth_client :
763
+ pytest .skip ("authentication support needed" )
764
+
765
+ expression = "linspace(0, 10)"
766
+ lxname = "my_expr"
762
767
768
+ auth_client .subscribe (TEST_CATERVA2_ROOT )
763
769
770
+ # Uncomputed lazyexpr is a blosc2 lazyexpr
771
+ lxpath = auth_client .lazyexpr (lxname , expression , compute = False )
772
+ assert lxpath == pathlib .Path (f"@personal/{ lxname } .b2nd" )
773
+ c = auth_client .get (lxpath )
774
+ assert c .meta ["expression" ] == expression
775
+
776
+ # Computed lazyexpr is a blosc2 array
777
+ lxpath = auth_client .lazyexpr (lxname , expression , compute = True )
778
+ assert lxpath == pathlib .Path (f"@personal/{ lxname } .b2nd" )
779
+ c = auth_client .get (lxpath )
780
+ assert c .meta .get ("expression" , None ) is None
781
+
782
+
783
+ # User management
764
784
def test_adduser (auth_client ):
765
785
if not auth_client :
766
786
pytest .skip ("authentication support needed" )
0 commit comments