3838 write_manifest ,
3939 write_manifest_list ,
4040)
41- from pyiceberg .partitioning import UNPARTITIONED_PARTITION_SPEC , PartitionField , PartitionSpec
41+ from pyiceberg .partitioning import UNPARTITIONED_PARTITION_SPEC , PartitionSpec
4242from pyiceberg .schema import Schema
4343from pyiceberg .table .snapshots import Operation , Snapshot , Summary
44- from pyiceberg .transforms import IdentityTransform
4544from pyiceberg .typedef import Record , TableVersion
4645from pyiceberg .types import IntegerType , NestedField
4746
@@ -363,6 +362,8 @@ def test_write_manifest(
363362 generated_manifest_file_file_v1 : str ,
364363 generated_manifest_file_file_v2 : str ,
365364 format_version : TableVersion ,
365+ test_schema : Schema ,
366+ test_partition_spec : PartitionSpec ,
366367 compression : AvroCompressionCodec ,
367368) -> None :
368369 io = load_file_io ()
@@ -376,20 +377,12 @@ def test_write_manifest(
376377 )
377378 demo_manifest_file = snapshot .manifests (io )[0 ]
378379 manifest_entries = demo_manifest_file .fetch_manifest_entry (io )
379- test_schema = Schema (
380- NestedField (1 , "VendorID" , IntegerType (), False ), NestedField (2 , "tpep_pickup_datetime" , IntegerType (), False )
381- )
382- test_spec = PartitionSpec (
383- PartitionField (source_id = 1 , field_id = 1 , transform = IdentityTransform (), name = "VendorID" ),
384- PartitionField (source_id = 2 , field_id = 2 , transform = IdentityTransform (), name = "tpep_pickup_datetime" ),
385- spec_id = demo_manifest_file .partition_spec_id ,
386- )
387380 with TemporaryDirectory () as tmpdir :
388381 tmp_avro_file = tmpdir + "/test_write_manifest.avro"
389382 output = io .new_output (tmp_avro_file )
390383 with write_manifest (
391384 format_version = format_version ,
392- spec = test_spec ,
385+ spec = test_partition_spec ,
393386 schema = test_schema ,
394387 output_file = output ,
395388 snapshot_id = 8744736658442914487 ,
@@ -404,7 +397,7 @@ def test_write_manifest(
404397
405398 expected_metadata = {
406399 "schema" : test_schema .model_dump_json (),
407- "partition-spec" : """[{"source-id":1,"field-id":1 ,"transform":"identity","name":"VendorID"},{"source-id":2,"field-id":2 ,"transform":"identity ","name":"tpep_pickup_datetime"}]""" ,
400+ "partition-spec" : """[{"source-id":1,"field-id":1000 ,"transform":"identity","name":"VendorID"},{"source-id":2,"field-id":1001 ,"transform":"day ","name":"tpep_pickup_datetime"}]""" ,
408401 "partition-spec-id" : str (demo_manifest_file .partition_spec_id ),
409402 "format-version" : str (format_version ),
410403 }
0 commit comments