@@ -115,7 +115,7 @@ def test_invalid_column_contents(
115115 df = df_type ({"a" : [1 , 2 , 3 ], "b" : ["x" , "longtext" , None ], "c" : ["1" , None , "3" ]})
116116 with pytest .raises (
117117 ValidationError if eager else plexc .ComputeError ,
118- match = r"2 rules failed validation" ,
118+ match = r"2 rules failed validation" if eager else None ,
119119 ):
120120 _validate_and_collect (MySchema , df , eager = eager )
121121 assert not MySchema .is_valid (df )
@@ -143,7 +143,7 @@ def test_violated_custom_rule(
143143 df = df_type ({"a" : [1 , 1 , 2 , 3 , 3 ], "b" : [2 , 2 , 2 , 4 , 5 ]})
144144 with pytest .raises (
145145 ValidationError if eager else plexc .ComputeError ,
146- match = r"2 rules failed validation" ,
146+ match = r"2 rules failed validation" if eager else None ,
147147 ):
148148 _validate_and_collect (MyComplexSchema , df , eager = eager )
149149 assert not MyComplexSchema .is_valid (df )
@@ -285,7 +285,19 @@ def test_multiple_unique_columns_both_invalid(
285285 df = df_type ({"a" : [1 , 1 , 3 ], "b" : ["x" , "y" , "y" ]})
286286 with pytest .raises (
287287 ValidationError if eager else plexc .ComputeError ,
288- match = r"2 rules failed validation" ,
288+ match = r"2 rules failed validation" if eager else None ,
289289 ):
290290 _validate_and_collect (MultiUniqueSchema , df , eager = eager )
291291 assert not MultiUniqueSchema .is_valid (df )
292+
293+
294+ # ----------------------------------- PERFORMANCE ------------------------------------ #
295+
296+
297+ def test_lazy_validate_does_not_block_streaming_engine () -> None :
298+ schema = create_schema ("test" , {"a" : dy .Int64 (), "b" : dy .Int64 ()})
299+ lf = pl .LazyFrame ({"a" : [1 , 2 , 3 ], "b" : [2 , 3 , 4 ]}).lazy ()
300+ out = schema .validate (lf , eager = False )
301+ graph = out .show_graph (engine = "streaming" , plan_stage = "physical" , raw_output = True )
302+ assert graph is not None
303+ assert "in-memory-map" not in graph
0 commit comments