File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,10 +207,12 @@ def _pl_tree_to_sql(tree: _ExpressionTree) -> str:
207207 "Int16" ,
208208 "Int32" ,
209209 "Int64" ,
210+ "Int128" ,
210211 "UInt8" ,
211212 "UInt16" ,
212213 "UInt32" ,
213214 "UInt64" ,
215+ "UInt128" ,
214216 "Float32" ,
215217 "Float64" ,
216218 "Boolean" ,
Original file line number Diff line number Diff line change @@ -681,6 +681,30 @@ def test_invalid_expr_json(self):
681681 with pytest .raises (AssertionError , match = "The col name of a Column should be a str but got" ):
682682 _pl_tree_to_sql (json .loads (bad_type_expr ))
683683
684+ @pytest .mark .parametrize (
685+ ("dtype" , "test_value" ),
686+ [
687+ (pl .Int8 , 1 ),
688+ (pl .Int16 , 1 ),
689+ (pl .Int32 , 1 ),
690+ (pl .Int64 , 1 ),
691+ (pl .Int128 , 1 ),
692+ (pl .UInt8 , 1 ),
693+ (pl .UInt16 , 1 ),
694+ (pl .UInt32 , 1 ),
695+ (pl .UInt64 , 1 ),
696+ (pl .UInt128 , 1 ),
697+ (pl .Float32 , 1.0 ),
698+ (pl .Float64 , 1.0 ),
699+ (pl .Boolean , True ),
700+ ],
701+ )
702+ def test_scalar_type_pushdown (self , dtype , test_value ):
703+ """Verify that literals of each scalar type can be pushed down."""
704+ expr = pl .col ("a" ) == pl .lit (test_value , dtype = dtype )
705+ sql_expression = _predicate_to_expression (expr )
706+ assert sql_expression is not None , f"Pushdown failed for { dtype } "
707+
684708 def test_decimal_scale (self ):
685709 scalar_decimal_no_scale = """
686710 { "Scalar": {
You can’t perform that action at this time.
0 commit comments