Garrett Weaver
02/12/2026, 10:18 PM_partition_fields_to_pyiceberg_spec sets the name to the same name as the source field.
source_field = iceberg_schema.find_field(pf.field.name)
iceberg_partition_fields.append(
PyIcebergPartitionField(
source_id=source_field.field_id,
field_id=1000 + idx,
transform=transform,
name=pf.field.name,
)
)
we could (1) try to create a unique name automatically or (2) allow user to pass the name.Garrett Weaver
02/12/2026, 10:21 PMValueError: Cannot create partition with a name that exists in schema: aGarrett Weaver
02/12/2026, 11:21 PMGarrett Weaver
02/12/2026, 11:54 PMsource_field = iceberg_schema.find_field(pf.field.name)
field_id = len(iceberg_schema.fields) + idx
name = f"__pyiceberg_partition_field_{pf.field.name}_{field_id}"
iceberg_partition_fields.append(
PyIcebergPartitionField(
source_id=source_field.field_id,
field_id=field_id,
transform=transform,
name=name,
)
)