File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,10 +197,12 @@ def _pl_tree_to_sql(tree: _ExpressionTree) -> str:
197197 "Int16" ,
198198 "Int32" ,
199199 "Int64" ,
200+ "Int128" ,
200201 "UInt8" ,
201202 "UInt16" ,
202203 "UInt32" ,
203204 "UInt64" ,
205+ "UInt128" ,
204206 "Float32" ,
205207 "Float64" ,
206208 "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