Skip to content

Commit fe51b41

Browse files
committed
Update mehtod signature of _files()
1 parent b38629d commit fe51b41

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pyiceberg/table/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4308,7 +4308,9 @@ def history(self) -> "pa.Table":
43084308

43094309
return pa.Table.from_pylist(history, schema=history_schema)
43104310

4311-
def _files(self, snapshot_id: Optional[int] = None, file_content_type: str = "all") -> "pa.Table":
4311+
def _files(
4312+
self, snapshot_id: Optional[int] = None, data_file_content_types: Optional[List[DataFileContent]] = None
4313+
) -> "pa.Table":
43124314
import pyarrow as pa
43134315

43144316
from pyiceberg.io.pyarrow import schema_to_pyarrow
@@ -4365,9 +4367,7 @@ def _readable_metrics_struct(bound_type: PrimitiveType) -> pa.StructType:
43654367
for manifest_list in snapshot.manifests(io):
43664368
for manifest_entry in manifest_list.fetch_manifest_entry(io):
43674369
data_file = manifest_entry.data_file
4368-
if file_content_type == "data" and data_file.content != DataFileContent.DATA:
4369-
continue
4370-
if file_content_type == "delete" and data_file.content == DataFileContent.DATA:
4370+
if data_file_content_types and data_file.content not in data_file_content_types:
43714371
continue
43724372
column_sizes = data_file.column_sizes or {}
43734373
value_counts = data_file.value_counts or {}
@@ -4419,10 +4419,10 @@ def files(self, snapshot_id: Optional[int] = None) -> "pa.Table":
44194419
return self._files(snapshot_id)
44204420

44214421
def data_files(self, snapshot_id: Optional[int] = None) -> "pa.Table":
4422-
return self._files(snapshot_id, "data")
4422+
return self._files(snapshot_id, [DataFileContent.DATA])
44234423

44244424
def delete_files(self, snapshot_id: Optional[int] = None) -> "pa.Table":
4425-
return self._files(snapshot_id, "delete")
4425+
return self._files(snapshot_id, [DataFileContent.POSITION_DELETES, DataFileContent.EQUALITY_DELETES])
44264426

44274427

44284428
class _ManifestMergeManager(Generic[U]):

0 commit comments

Comments
 (0)