File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 6969LOGICAL_FIELD_TYPE_MAPPING : Dict [Tuple [str , str ], PrimitiveType ] = {
7070 ("date" , "int" ): DateType (),
7171 ("time-micros" , "long" ): TimeType (),
72+ ("timestamp-millis" , "int" ): TimestampType (),
7273 ("timestamp-micros" , "long" ): TimestampType (),
7374 ("uuid" , "fixed" ): UUIDType (),
7475}
Original file line number Diff line number Diff line change 3333 NestedField ,
3434 StringType ,
3535 StructType ,
36+ TimestampType ,
3637 UnknownType ,
3738)
3839from pyiceberg .utils .schema_conversion import AvroSchemaConversion
@@ -327,6 +328,18 @@ def test_convert_date_type() -> None:
327328 assert actual == DateType ()
328329
329330
331+ def test_convert_timestamp_millis_type () -> None :
332+ avro_logical_type = {"type" : "int" , "logicalType" : "timestamp-millis" }
333+ actual = AvroSchemaConversion ()._convert_logical_type (avro_logical_type )
334+ assert actual == TimestampType ()
335+
336+
337+ def test_convert_timestamp_micros_type () -> None :
338+ avro_logical_type = {"type" : "int" , "logicalType" : "timestamp-micros" }
339+ actual = AvroSchemaConversion ()._convert_logical_type (avro_logical_type )
340+ assert actual == TimestampType ()
341+
342+
330343def test_unknown_logical_type () -> None :
331344 """Test raising a ValueError when converting an unknown logical type as part of an Avro schema conversion"""
332345 avro_logical_type = {"type" : "bytes" , "logicalType" : "date" }
You can’t perform that action at this time.
0 commit comments