Fokko commented on code in PR #1644:
URL: https://github.com/apache/iceberg-python/pull/1644#discussion_r2175469014


##########
pyiceberg/expressions/visitors.py:
##########
@@ -893,15 +893,28 @@ def visit_unbound_predicate(self, predicate: 
UnboundPredicate[L]) -> BooleanExpr
         raise TypeError(f"Expected Bound Predicate, got: {predicate.term}")
 
     def visit_bound_predicate(self, predicate: BoundPredicate[L]) -> 
BooleanExpression:
-        file_column_name = 
self.file_schema.find_column_name(predicate.term.ref().field.field_id)
+        field = predicate.term.ref().field
+        file_column_name = self.file_schema.find_column_name(field.field_id)
 
         if file_column_name is None:
             # In the case of schema evolution, the column might not be present
-            # in the file schema when reading older data
-            if isinstance(predicate, BoundIsNull):

Review Comment:
   `BoundIsNull` is part of the `BoundUnaryPredicate`:
   
   <img width="552" alt="image" 
src="https://github.com/user-attachments/assets/2ea41fea-21a9-4a6a-91f6-dfbdedec1348";
 />
   
   This generalized pretty well, because for ≤2 tables the default value is 
always `null`, which covers the previous behavior. Those are already covered by 
tests: 
https://github.com/apache/iceberg-python/commit/5af05bd57c94667e3760423fcdac5f9ce9e5ca6e



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to