2424
2525from pyiceberg .catalog import Catalog , load_catalog
2626from pyiceberg .exceptions import CommitFailedException , NoSuchTableError , ValidationError
27- from pyiceberg .expressions import literal # type: ignore
2827from pyiceberg .partitioning import PartitionField , PartitionSpec
2928from pyiceberg .schema import Schema , prune_columns
3029from pyiceberg .table import Table , TableProperties
@@ -1100,25 +1099,25 @@ def test_add_required_column(catalog: Catalog) -> None:
11001099@pytest .mark .parametrize (
11011100 "iceberg_type, default_value, write_default" ,
11021101 [
1103- # (BooleanType(), True, False),
1104- # (IntegerType(), 123, 456),
1105- # (LongType(), 123, 456),
1106- # (FloatType(), 19.25, 22.27),
1107- # (DoubleType(), 19.25, 22.27),
1102+ (BooleanType (), True , False ),
1103+ (IntegerType (), 123 , 456 ),
1104+ (LongType (), 123 , 456 ),
1105+ (FloatType (), 19.25 , 22.27 ),
1106+ (DoubleType (), 19.25 , 22.27 ),
11081107 (DecimalType (10 , 2 ), Decimal ("19.25" ), Decimal ("22.27" )),
1109- # (DecimalType(10, 2), Decimal("19.25"), Decimal("22.27")),
1110- # (StringType(), "abc", "def"),
1111- # (DateType(), date(1990, 3, 1), date(1991, 3, 1)),
1112- # (TimeType(), time(19, 25, 22), time(22, 25, 22)),
1113- # (TimestampType(), datetime(1990, 5, 1, 22, 1, 1), datetime(2000, 5, 1, 22, 1, 1)),
1114- # (
1115- # TimestamptzType(),
1116- # datetime(1990, 5, 1, 22, 1, 1, tzinfo=timezone.utc),
1117- # datetime(2000, 5, 1, 22, 1, 1, tzinfo=timezone.utc),
1118- # ),
1119- # (BinaryType(), b"123", b"456"),
1120- # (FixedType(4), b"1234", b"5678"),
1121- # (UUIDType(), UUID(int=0x12345678123456781234567812345678), UUID(int=0x32145678123456781234567812345678)),
1108+ (DecimalType (10 , 2 ), Decimal ("19.25" ), Decimal ("22.27" )),
1109+ (StringType (), "abc" , "def" ),
1110+ (DateType (), date (1990 , 3 , 1 ), date (1991 , 3 , 1 )),
1111+ (TimeType (), time (19 , 25 , 22 ), time (22 , 25 , 22 )),
1112+ (TimestampType (), datetime (1990 , 5 , 1 , 22 , 1 , 1 ), datetime (2000 , 5 , 1 , 22 , 1 , 1 )),
1113+ (
1114+ TimestamptzType (),
1115+ datetime (1990 , 5 , 1 , 22 , 1 , 1 , tzinfo = timezone .utc ),
1116+ datetime (2000 , 5 , 1 , 22 , 1 , 1 , tzinfo = timezone .utc ),
1117+ ),
1118+ (BinaryType (), b"123" , b"456" ),
1119+ (FixedType (4 ), b"1234" , b"5678" ),
1120+ (UUIDType (), UUID (int = 0x12345678123456781234567812345678 ), UUID (int = 0x32145678123456781234567812345678 )),
11221121 ],
11231122)
11241123def test_initial_default_all_columns (
@@ -1132,17 +1131,15 @@ def test_initial_default_all_columns(
11321131 tx .commit ()
11331132
11341133 field = table .schema ().find_field (1 )
1135- physical_type = literal (default_value ).to (iceberg_type ).value
1136- assert field .initial_default == physical_type
1137- assert field .write_default == physical_type
1134+ assert field .initial_default == default_value
1135+ assert field .write_default == default_value
11381136
11391137 with table .update_schema () as tx :
11401138 tx .set_default_value ("data" , write_default )
11411139
11421140 field = table .schema ().find_field (1 )
1143- write_physical_type = literal (default_value ).to (iceberg_type ).value
1144- assert field .initial_default == physical_type
1145- assert field .write_default == write_physical_type
1141+ assert field .initial_default == default_value
1142+ assert field .write_default == write_default
11461143
11471144
11481145@pytest .mark .integration
0 commit comments