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


##########
pyiceberg/transforms.py:
##########
@@ -521,6 +556,16 @@ def project(self, name: str, pred: BoundPredicate[L]) -> 
Optional[UnboundPredica
         else:
             raise ValueError(f"Could not project: {pred}")
 
+    def strict_project(self, name: str, pred: BoundPredicate[Any]) -> 
Optional[UnboundPredicate[Any]]:
+        if isinstance(pred, BoundUnaryPredicate):
+            return pred.as_unbound(Reference(name))
+        elif isinstance(pred, BoundLiteralPredicate):
+            return pred.as_unbound(Reference(name), pred.literal)
+        elif isinstance(pred, BoundSetPredicate):
+            return pred.as_unbound(Reference(name), pred.literals)
+        else:
+            raise ValueError(f"Could not project: {pred}")

Review Comment:
   Good question. It is code that's not being hit since we can always project 
identity transforms. I've changed it to return None.



-- 
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