Fokko commented on code in PR #1626: URL: https://github.com/apache/iceberg-python/pull/1626#discussion_r2074942264
########## pyiceberg/table/inspect.py: ########## @@ -570,71 +630,25 @@ def _readable_metrics_struct(bound_type: PrimitiveType) -> pa.StructType: pa.field("readable_metrics", pa.struct(readable_metrics_struct), nullable=True), ] ) + return files_schema - files: list[dict[str, Any]] = [] + def _files(self, snapshot_id: Optional[int] = None, data_file_filter: Optional[Set[DataFileContent]] = None) -> "pa.Table": + import pyarrow as pa + + files_table: list[pa.Table] = [] if not snapshot_id and not self.tbl.metadata.current_snapshot(): return pa.Table.from_pylist( - files, - schema=files_schema, + [], + schema=self._get_files_schema(), ) Review Comment: Nice one, this can be further simplified to: ```python return self._get_files_schema().empty_table() ``` Less is more :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org