@@ -99,6 +99,7 @@ def __init__(
9999 BooleanFunction .Name .All ,
100100 BooleanFunction .Name .Any ,
101101 BooleanFunction .Name .IsDuplicated ,
102+ BooleanFunction .Name .IsEmpty ,
102103 BooleanFunction .Name .IsFirstDistinct ,
103104 BooleanFunction .Name .IsLastDistinct ,
104105 BooleanFunction .Name .IsSorted ,
@@ -107,7 +108,6 @@ def __init__(
107108 if self .name in {
108109 BooleanFunction .Name .HasNulls ,
109110 BooleanFunction .Name .IsClose ,
110- BooleanFunction .Name .IsEmpty ,
111111 }:
112112 raise NotImplementedError (
113113 f"Boolean function { self .name } "
@@ -192,6 +192,19 @@ def do_evaluate(
192192 self , df : DataFrame , * , context : ExecutionContext = ExecutionContext .FRAME
193193 ) -> Column :
194194 """Evaluate this expression given a dataframe for context."""
195+ if self .name is BooleanFunction .Name .IsEmpty :
196+ (child ,) = self .children
197+ column = child .evaluate (df , context = context )
198+ return Column (
199+ plc .Column .from_scalar (
200+ plc .Scalar .from_py (
201+ column .size == 0 , self .dtype .plc_type , stream = df .stream
202+ ),
203+ 1 ,
204+ stream = df .stream ,
205+ ),
206+ dtype = self .dtype ,
207+ )
195208 if self .name in (
196209 BooleanFunction .Name .IsFinite ,
197210 BooleanFunction .Name .IsInfinite ,
0 commit comments