ResidualVisitor.visit_not_starts_with appears to always return AlwaysFalse() for partitioned residuals because it applies Python not to the AlwaysTrue() / AlwaysFalse() object returned by visit_starts_with.
Example with an identity partition:
partition value: x_part = "bb"
filter: NotStartsWith("x", "a")
actual residual: AlwaysFalse()
expected residual: AlwaysTrue()
This can attach an incorrect residual to planned scan tasks.
Relevant code: pyiceberg/expressions/visitors.py ResidualVisitor.visit_not_starts_with.
ResidualVisitor.visit_not_starts_withappears to always returnAlwaysFalse()for partitioned residuals because it applies Pythonnotto theAlwaysTrue()/AlwaysFalse()object returned byvisit_starts_with.Example with an identity partition:
This can attach an incorrect residual to planned scan tasks.
Relevant code:
pyiceberg/expressions/visitors.pyResidualVisitor.visit_not_starts_with.