samredai commented on issue #3464:
URL: https://github.com/apache/iceberg/issues/3464#issuecomment-962381119


   One thing I noticed about how types.py is currently is that because the 
types are a mix of classes (`DecimalType`, `FixedType`, etc) and instances 
(`BooleanType`, `IntegerType`, etc), checking a type is a little inconsistent. 
For example:
   ```py
   type_1 = FixedType(8)
   isinstance(type_1, FixedType)  # True
   
   type_2 = BooleanType
   isinstance(type_2, BooleanType)  # False
   type_2 == BooleanType  # True
   ```
   
   If using dataclasses gives us the expected behavior for all relevant dunder 
methods (or even 90%, we can override any of them), and it allows us to 
consolidate the logic in literals.py and types.py, that would cut down the code 
significantly. I think it's worth trying out and validating against existing 
tests.


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