@@ -471,6 +471,9 @@ def _create_int64(shape, array_module):
471471 def _create_uint32 (shape , array_module ):
472472 return array_module .zeros (shape , dtype = 'u4' )
473473
474+ def __repr__ (self ):
475+ return f"{ type (self ).__name__ } ({ self .column !r} )"
476+
474477
475478class OptionalFieldReduction (Reduction ):
476479 """Base class for things like ``count`` or ``any`` for which the field is optional"""
@@ -657,6 +660,9 @@ def _combine_antialias(aggs):
657660 nansum_in_place (ret , aggs [i ])
658661 return ret
659662
663+ def __repr__ (self ):
664+ return "count()"
665+
660666
661667class _count_ignore_antialiasing (count ):
662668 """Count reduction but ignores antialiasing. Used by mean reduction.
@@ -813,6 +819,9 @@ def finalize(bases, cuda=False, **kwargs):
813819
814820 return finalize
815821
822+ def __repr__ (self ):
823+ return f"{ type (self ).__name__ } (column={ self .column !r} , reduction={ self .reduction !r} )"
824+
816825class any (OptionalFieldReduction ):
817826 """Whether any elements in ``column`` map to each bin.
818827
@@ -1265,6 +1274,8 @@ class count_cat(by):
12651274 def __init__ (self , column ):
12661275 super ().__init__ (column , count ())
12671276
1277+ def __repr__ (self ):
1278+ return f"count_cat(column={ self .column !r} )"
12681279
12691280class mean (Reduction ):
12701281 """Mean of all elements in ``column``.
@@ -1477,6 +1488,9 @@ def finalize(bases, cuda=False, **kwargs):
14771488 def _hashable_inputs (self ):
14781489 return super ()._hashable_inputs () + (self .n ,)
14791490
1491+ def __repr__ (self ):
1492+ return f"{ type (self ).__name__ } (column={ self .column !r} , n={ self .n !r} )"
1493+
14801494
14811495class _first_n_or_last_n (FloatingNReduction ):
14821496 """Abstract base class of first_n and last_n reductions.
@@ -2103,6 +2117,9 @@ def finalize(bases, cuda=False, **kwargs):
21032117
21042118 return finalize
21052119
2120+ def __repr__ (self ):
2121+ return f"where(selector={ self .selector !r} , lookup_column={ self .column !r} )"
2122+
21062123
21072124class summary (Expr ):
21082125 """A collection of named reductions.
@@ -2166,6 +2183,10 @@ def validate(self, input_dshape):
21662183 def inputs (self ):
21672184 return tuple (unique (concat (v .inputs for v in self .values )))
21682185
2186+ def __repr__ (self ):
2187+ pairs = ", " .join ([f"{ k } ={ v !r} " for k , v in zip (self .keys , self .values , strict = True )])
2188+ return f"summary({ pairs } )"
2189+
21692190
21702191class _max_or_min_row_index (OptionalFieldReduction ):
21712192 """Abstract base class of max and min row_index reductions.
0 commit comments