Skip to content

Commit 9bdf5c7

Browse files
committed
Fix order of fields in files schema
1 parent 2bce484 commit 9bdf5c7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyiceberg/table/inspect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,8 @@ def _get_files_from_manifest(
567567
"content": data_file.content,
568568
"file_path": data_file.file_path,
569569
"file_format": data_file.file_format,
570-
"partition": partition_record_dict,
571570
"spec_id": data_file.spec_id,
571+
"partition": partition_record_dict,
572572
"record_count": data_file.record_count,
573573
"file_size_in_bytes": data_file.file_size_in_bytes,
574574
"column_sizes": dict(data_file.column_sizes) if data_file.column_sizes is not None else None,
@@ -623,8 +623,8 @@ def _readable_metrics_struct(bound_type: PrimitiveType) -> pa.StructType:
623623
pa.field("content", pa.int8(), nullable=False),
624624
pa.field("file_path", pa.string(), nullable=False),
625625
pa.field("file_format", pa.dictionary(pa.int32(), pa.string()), nullable=False),
626-
pa.field("partition", pa_record_struct, nullable=False),
627626
pa.field("spec_id", pa.int32(), nullable=False),
627+
pa.field("partition", pa_record_struct, nullable=False),
628628
pa.field("record_count", pa.int64(), nullable=False),
629629
pa.field("file_size_in_bytes", pa.int64(), nullable=False),
630630
pa.field("column_sizes", pa.map_(pa.int32(), pa.int64()), nullable=True),

tests/integration/test_inspect_table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def _inspect_files_asserts(df: pa.Table, spark_df: DataFrame) -> None:
7878
"content",
7979
"file_path",
8080
"file_format",
81-
"partition",
8281
"spec_id",
82+
"partition",
8383
"record_count",
8484
"file_size_in_bytes",
8585
"column_sizes",
@@ -837,8 +837,8 @@ def inspect_files_asserts(df: pa.Table) -> None:
837837
"content",
838838
"file_path",
839839
"file_format",
840-
"partition",
841840
"spec_id",
841+
"partition",
842842
"record_count",
843843
"file_size_in_bytes",
844844
"column_sizes",

0 commit comments

Comments
 (0)