@@ -91,7 +91,7 @@ class ITable(AbstractTable):
9191 source_table : Any
9292 schema : Schema = None
9393
94- def select (self , * exprs , distinct = SKIP , optimizer_hints = SKIP , ** named_exprs ):
94+ def select (self , * exprs , distinct = SKIP , optimizer_hints = SKIP , ** named_exprs ) -> "ITable" :
9595 """Create a new table with the specified fields"""
9696 exprs = args_as_tuple (exprs )
9797 exprs = _drop_skips (exprs )
@@ -248,6 +248,12 @@ def test_regex(self, other):
248248 def sum (self ):
249249 return Func ("SUM" , [self ])
250250
251+ def max (self ):
252+ return Func ("MAX" , [self ])
253+
254+ def min (self ):
255+ return Func ("MIN" , [self ])
256+
251257
252258@dataclass
253259class TestRegex (ExprNode , LazyOps ):
@@ -261,7 +267,7 @@ def compile(self, c: Compiler) -> str:
261267 return c .compile (regex )
262268
263269
264- @dataclass
270+ @dataclass ( eq = False )
265271class Func (ExprNode , LazyOps ):
266272 name : str
267273 args : Sequence [Expr ]
@@ -525,7 +531,7 @@ def schema(self):
525531 s = self .source_tables [0 ].schema # TODO validate types match between both tables
526532 return type (s )({c .name : c .type for c in self .columns })
527533
528- def on (self , * exprs ):
534+ def on (self , * exprs ) -> "Join" :
529535 """Add an ON clause, for filtering the result of the cartesian product (i.e. the JOIN)"""
530536 if len (exprs ) == 1 :
531537 (e ,) = exprs
@@ -538,7 +544,7 @@ def on(self, *exprs):
538544
539545 return self .replace (on_exprs = (self .on_exprs or []) + exprs )
540546
541- def select (self , * exprs , ** named_exprs ):
547+ def select (self , * exprs , ** named_exprs ) -> ITable :
542548 """Select fields to return from the JOIN operation
543549
544550 See Also: ``ITable.select()``
0 commit comments