@@ -1025,20 +1025,21 @@ def test_projection_truncate_string_starts_with(bound_reference_str: BoundRefere
10251025 ) == StartsWith (term = "name" , literal = literal ("he" ))
10261026
10271027
1028- def test_projection_truncate_string_not_starts_with (bound_reference_str : BoundReference ) -> None :
1029- # literal_width (5) > truncate width (2): no inclusive projection possible (unsafe)
1028+ def test_projection_truncate_string_not_starts_with_longer_literal (bound_reference_str : BoundReference ) -> None :
1029+ # Not a valid projection: return None because pruning on "he" could drop qualifying rows like "help".
10301030 assert TruncateTransform (2 ).project ("name" , BoundNotStartsWith (term = bound_reference_str , literal = literal ("hello" ))) is None
10311031
10321032
10331033def test_projection_truncate_string_not_starts_with_shorter_literal (bound_reference_str : BoundReference ) -> None :
1034- # literal_width (2) == truncate width (2): project to !=
1034+ def test_projection_truncate_string_not_starts_with_equal_width_literal (bound_reference_str : BoundReference ) -> None :
1035+ # Valid projection: improve NOT STARTS WITH "he" to partition != "he".
10351036 assert TruncateTransform (2 ).project (
10361037 "name" , BoundNotStartsWith (term = bound_reference_str , literal = literal ("he" ))
10371038 ) == NotEqualTo (term = "name" , literal = literal ("he" ))
10381039
10391040
1040- def test_projection_truncate_string_not_starts_with_original_literal (bound_reference_str : BoundReference ) -> None :
1041- # literal_width (1) < truncate width (2): keep original literal
1041+ def test_projection_truncate_string_not_starts_with_shorter_literal (bound_reference_str : BoundReference ) -> None :
1042+ # Valid projection: pass the NOT STARTS WITH literal "h" through unchanged.
10421043 assert TruncateTransform (2 ).project (
10431044 "name" , BoundNotStartsWith (term = bound_reference_str , literal = literal ("h" ))
10441045 ) == NotStartsWith (term = "name" , literal = literal ("h" ))
0 commit comments