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/07 07:06:49 UTC

[GitHub] [iceberg] Fokko commented on a diff in pull request #6128: Python: Projection

Fokko commented on code in PR #6128:
URL: https://github.com/apache/iceberg/pull/6128#discussion_r1015064168


##########
python/pyiceberg/expressions/__init__.py:
##########
@@ -68,7 +72,6 @@ def eval(self, struct: StructProtocol) -> T:  # pylint: disable=W0613
         """Returns the value at the referenced field's position in an object that abides by the StructProtocol"""
 
 
-@dataclass(frozen=True)

Review Comment:
   The rationale is in the PR description. Mostly because my IDE lights up as a Christmas tree, and it is a bit early. It seems that the dataclasses + IDE + mypy don't really know what to do with the inheritance of the different classes.
   
   ![image](https://user-images.githubusercontent.com/1134248/200243609-26f1a3c1-378b-49a7-a1fd-94f747cc16c2.png)
   
   A very slimmed-down example is given in the post around `Reference`:
   
   ![image](https://user-images.githubusercontent.com/1134248/200150958-3634a40c-a530-424c-956d-94b843bb5cb9.png)
   
   PyCharm is unable to figure out the argument:
   
   ![image](https://user-images.githubusercontent.com/1134248/200245808-a5db142c-98dc-4e8b-9f66-94296f8bcde7.png)
   
   It turns out that you shouldn't use positional arguments with data classes: https://medium.com/@aniscampos/python-dataclass-inheritance-finally-686eaf60fbb5



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