HonahX commented on code in PR #955:
URL: https://github.com/apache/iceberg-python/pull/955#discussion_r1690505567


##########
pyiceberg/io/pyarrow.py:
##########
@@ -576,11 +572,11 @@ def _convert_scalar(value: Any, iceberg_type: 
IcebergType) -> pa.scalar:
 
 
 class _ConvertToArrowExpression(BoundBooleanExpressionVisitor[pc.Expression]):
-    def visit_in(self, term: BoundTerm[pc.Expression], literals: Set[Any]) -> 
pc.Expression:
+    def visit_in(self, term: BoundTerm[L], literals: Set[L]) -> pc.Expression:

Review Comment:
   Thanks for spotting this. I think these are just missed from the last major 
typing fix of visitors:
   
   - https://github.com/apache/iceberg/pull/6258#discussion_r1034007197
   - 
https://github.com/apache/iceberg/pull/6308/files#diff-49144c27eab7e03926b0310aa8b513dbeb9c8d2a0d33bacf8dedbd88b4680aac
   
   Given that this is in a concrete class, how about we just use `Any` to 
indicate that we accept general terms?
   ```suggestion
       def visit_in(self, term: BoundTerm[Any], literals: Set[Any]) -> 
pc.Expression:
   ```
   
   which is also consistent with the type in other methods.



##########
pyiceberg/io/pyarrow.py:
##########
@@ -576,11 +572,11 @@ def _convert_scalar(value: Any, iceberg_type: 
IcebergType) -> pa.scalar:
 
 
 class _ConvertToArrowExpression(BoundBooleanExpressionVisitor[pc.Expression]):
-    def visit_in(self, term: BoundTerm[pc.Expression], literals: Set[Any]) -> 
pc.Expression:
+    def visit_in(self, term: BoundTerm[L], literals: Set[L]) -> pc.Expression:

Review Comment:
   Thanks for spotting this. I think these are just missed from the last major 
typing fix for the visitor:
   
   - https://github.com/apache/iceberg/pull/6258#discussion_r1034007197
   - 
https://github.com/apache/iceberg/pull/6308/files#diff-49144c27eab7e03926b0310aa8b513dbeb9c8d2a0d33bacf8dedbd88b4680aac
   
   Given that this is in a concrete class, how about we just use `Any` to 
indicate that we accept general terms?
   ```suggestion
       def visit_in(self, term: BoundTerm[Any], literals: Set[Any]) -> 
pc.Expression:
   ```
   
   which is also consistent with the type in other methods.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to