You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/11/20 20:24:18 UTC

[GitHub] [iceberg] Fokko opened a new pull request, #6232: Python: Disallow Any generics

Fokko opened a new pull request, #6232:
URL: https://github.com/apache/iceberg/pull/6232

   Mypy allows us to warn when a type is missing:
   `List`, should be `List[str]`
   
   This way we don't accidentally forget any type (which happens to me all the time :).


-- 
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-unsubscribe@iceberg.apache.org

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


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


[GitHub] [iceberg] rdblue commented on a diff in pull request #6232: Python: Disallow Any generics

Posted by GitBox <gi...@apache.org>.
rdblue commented on code in PR #6232:
URL: https://github.com/apache/iceberg/pull/6232#discussion_r1028308314


##########
python/pyiceberg/expressions/literals.py:
##########
@@ -207,7 +207,7 @@ def __init__(self, value: int):
         super().__init__(value, int)
 
     @singledispatchmethod
-    def to(self, type_var: IcebergType) -> Literal:
+    def to(self, type_var: IcebergType) -> Literal:  # type: ignore

Review Comment:
   Is there no way to return an unknown type from a method in Python? In Java, we would just declare that the method returns `Literal<T>` where `T` comes from context. Then you get a type that may not be correct, but is at least not `<nothing>`.



-- 
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-unsubscribe@iceberg.apache.org

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


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


[GitHub] [iceberg] Fokko commented on a diff in pull request #6232: Python: Disallow Any generics

Posted by GitBox <gi...@apache.org>.
Fokko commented on code in PR #6232:
URL: https://github.com/apache/iceberg/pull/6232#discussion_r1028473547


##########
python/pyiceberg/expressions/literals.py:
##########
@@ -207,7 +207,7 @@ def __init__(self, value: int):
         super().__init__(value, int)
 
     @singledispatchmethod
-    def to(self, type_var: IcebergType) -> Literal:
+    def to(self, type_var: IcebergType) -> Literal:  # type: ignore

Review Comment:
   I don't like this either, the problem is that it is unbound. I have some idea's on how to fix this properly in https://github.com/apache/iceberg/issues/6231



-- 
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-unsubscribe@iceberg.apache.org

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


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


[GitHub] [iceberg] Fokko merged pull request #6232: Python: Disallow Any generics

Posted by GitBox <gi...@apache.org>.
Fokko merged PR #6232:
URL: https://github.com/apache/iceberg/pull/6232


-- 
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-unsubscribe@iceberg.apache.org

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


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