@@ -344,7 +344,7 @@ def test_deleting_hdfs_file_not_found() -> None:
344
344
assert "Cannot delete file, does not exist:" in str (exc_info .value )
345
345
346
346
347
- def test_schema_to_pyarrow_schema (table_schema_nested : Schema ) -> None :
347
+ def test_schema_to_pyarrow_schema_include_field_ids (table_schema_nested : Schema ) -> None :
348
348
actual = schema_to_pyarrow (table_schema_nested )
349
349
expected = """foo: string
350
350
-- field metadata --
@@ -402,6 +402,30 @@ def test_schema_to_pyarrow_schema(table_schema_nested: Schema) -> None:
402
402
assert repr (actual ) == expected
403
403
404
404
405
+ def test_schema_to_pyarrow_schema_exclude_field_ids (table_schema_nested : Schema ) -> None :
406
+ actual = schema_to_pyarrow (table_schema_nested , include_field_ids = False )
407
+ expected = """foo: string
408
+ bar: int32 not null
409
+ baz: bool
410
+ qux: list<element: string not null> not null
411
+ child 0, element: string not null
412
+ quux: map<string, map<string, int32>> not null
413
+ child 0, entries: struct<key: string not null, value: map<string, int32> not null> not null
414
+ child 0, key: string not null
415
+ child 1, value: map<string, int32> not null
416
+ child 0, entries: struct<key: string not null, value: int32 not null> not null
417
+ child 0, key: string not null
418
+ child 1, value: int32 not null
419
+ location: list<element: struct<latitude: float, longitude: float> not null> not null
420
+ child 0, element: struct<latitude: float, longitude: float> not null
421
+ child 0, latitude: float
422
+ child 1, longitude: float
423
+ person: struct<name: string, age: int32 not null>
424
+ child 0, name: string
425
+ child 1, age: int32 not null"""
426
+ assert repr (actual ) == expected
427
+
428
+
405
429
def test_fixed_type_to_pyarrow () -> None :
406
430
length = 22
407
431
iceberg_type = FixedType (length )
@@ -945,23 +969,13 @@ def test_projection_add_column(file_int: str) -> None:
945
969
== """id: int32
946
970
list: list<element: int32>
947
971
child 0, element: int32
948
- -- field metadata --
949
- PARQUET:field_id: '21'
950
972
map: map<int32, string>
951
973
child 0, entries: struct<key: int32 not null, value: string> not null
952
974
child 0, key: int32 not null
953
- -- field metadata --
954
- PARQUET:field_id: '31'
955
975
child 1, value: string
956
- -- field metadata --
957
- PARQUET:field_id: '32'
958
976
location: struct<lat: double, lon: double>
959
977
child 0, lat: double
960
- -- field metadata --
961
- PARQUET:field_id: '41'
962
- child 1, lon: double
963
- -- field metadata --
964
- PARQUET:field_id: '42'"""
978
+ child 1, lon: double"""
965
979
)
966
980
967
981
@@ -1014,11 +1028,7 @@ def test_projection_add_column_struct(schema_int: Schema, file_int: str) -> None
1014
1028
== """id: map<int32, string>
1015
1029
child 0, entries: struct<key: int32 not null, value: string> not null
1016
1030
child 0, key: int32 not null
1017
- -- field metadata --
1018
- PARQUET:field_id: '3'
1019
- child 1, value: string
1020
- -- field metadata --
1021
- PARQUET:field_id: '4'"""
1031
+ child 1, value: string"""
1022
1032
)
1023
1033
1024
1034
@@ -1062,12 +1072,7 @@ def test_projection_concat_files(schema_int: Schema, file_int: str) -> None:
1062
1072
def test_projection_filter (schema_int : Schema , file_int : str ) -> None :
1063
1073
result_table = project (schema_int , [file_int ], GreaterThan ("id" , 4 ))
1064
1074
assert len (result_table .columns [0 ]) == 0
1065
- assert (
1066
- repr (result_table .schema )
1067
- == """id: int32
1068
- -- field metadata --
1069
- PARQUET:field_id: '1'"""
1070
- )
1075
+ assert repr (result_table .schema ) == """id: int32"""
1071
1076
1072
1077
1073
1078
def test_projection_filter_renamed_column (file_int : str ) -> None :
@@ -1304,11 +1309,7 @@ def test_projection_nested_struct_different_parent_id(file_struct: str) -> None:
1304
1309
repr (result_table .schema )
1305
1310
== """location: struct<lat: double, long: double>
1306
1311
child 0, lat: double
1307
- -- field metadata --
1308
- PARQUET:field_id: '41'
1309
- child 1, long: double
1310
- -- field metadata --
1311
- PARQUET:field_id: '42'"""
1312
+ child 1, long: double"""
1312
1313
)
1313
1314
1314
1315
0 commit comments