Fokko commented on code in PR #43: URL: https://github.com/apache/iceberg-python/pull/43#discussion_r1349234820
########## pyiceberg/io/pyarrow.py: ########## @@ -1099,21 +1099,70 @@ def map_value_partner(self, partner_map: Optional[pa.Array]) -> Optional[pa.Arra return partner_map.items if isinstance(partner_map, pa.MapArray) else None -_PRIMITIVE_TO_PHYSICAL = { - BooleanType(): "BOOLEAN", - IntegerType(): "INT32", - LongType(): "INT64", - FloatType(): "FLOAT", - DoubleType(): "DOUBLE", - DateType(): "INT32", - TimeType(): "INT64", - TimestampType(): "INT64", - TimestamptzType(): "INT64", - StringType(): "BYTE_ARRAY", - UUIDType(): "FIXED_LEN_BYTE_ARRAY", - BinaryType(): "BYTE_ARRAY", -} -_PHYSICAL_TYPES = set(_PRIMITIVE_TO_PHYSICAL.values()).union({"INT96"}) +def _primitive_to_phyisical(iceberg_type: PrimitiveType) -> str: + return visit(iceberg_type, _PRIMITIVE_TO_PHYISCAL_TYPE_VISITOR) + + +class PrimitiveToPyhsicalType(SchemaVisitorPerPrimitiveType[str]): Review Comment: 🤣 Good old typo ########## pyiceberg/io/pyarrow.py: ########## @@ -1099,21 +1099,70 @@ def map_value_partner(self, partner_map: Optional[pa.Array]) -> Optional[pa.Arra return partner_map.items if isinstance(partner_map, pa.MapArray) else None -_PRIMITIVE_TO_PHYSICAL = { - BooleanType(): "BOOLEAN", - IntegerType(): "INT32", - LongType(): "INT64", - FloatType(): "FLOAT", - DoubleType(): "DOUBLE", - DateType(): "INT32", - TimeType(): "INT64", - TimestampType(): "INT64", - TimestamptzType(): "INT64", - StringType(): "BYTE_ARRAY", - UUIDType(): "FIXED_LEN_BYTE_ARRAY", - BinaryType(): "BYTE_ARRAY", -} -_PHYSICAL_TYPES = set(_PRIMITIVE_TO_PHYSICAL.values()).union({"INT96"}) +def _primitive_to_phyisical(iceberg_type: PrimitiveType) -> str: + return visit(iceberg_type, _PRIMITIVE_TO_PHYISCAL_TYPE_VISITOR) + + +class PrimitiveToPyhsicalType(SchemaVisitorPerPrimitiveType[str]): Review Comment: 🤣 Good old typo -- 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