Skip to content

Commit b54687e

Browse files
committed
Update mehtod signature of _files()
1 parent b7cfb4a commit b54687e

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

mkdocs/docs/api.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -845,16 +845,8 @@ readable_metrics: [
845845
[6.0989]]
846846
```
847847

848-
<!-- prettier-ignore-start -->
849-
850848
!!! info
851-
Content refers to type of content stored by the data file:
852-
853-
- 0 Data
854-
- 1 Position Deletes
855-
- 2 Equality Deletes
856-
857-
<!-- prettier-ignore-end -->
849+
Content refers to type of content stored by the data file: `0` - `Data`, `1` - `Position Deletes`, `2` - `Equality Deletes`
858850

859851
To show only data files or delete files in the current snapshot, use `table.inspect.data_files()` and `table.inspect.delete_files()` respectively.
860852

pyiceberg/table/__init__.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -4320,9 +4320,7 @@ def history(self) -> "pa.Table":
43204320

43214321
return pa.Table.from_pylist(history, schema=history_schema)
43224322

4323-
def _files(
4324-
self, snapshot_id: Optional[int] = None, data_file_content_types: Optional[List[DataFileContent]] = None
4325-
) -> "pa.Table":
4323+
def _files(self, snapshot_id: Optional[int] = None, data_file_filter: Optional[Set[DataFileContent]] = None) -> "pa.Table":
43264324
import pyarrow as pa
43274325

43284326
from pyiceberg.io.pyarrow import schema_to_pyarrow
@@ -4379,7 +4377,7 @@ def _readable_metrics_struct(bound_type: PrimitiveType) -> pa.StructType:
43794377
for manifest_list in snapshot.manifests(io):
43804378
for manifest_entry in manifest_list.fetch_manifest_entry(io):
43814379
data_file = manifest_entry.data_file
4382-
if data_file_content_types and data_file.content not in data_file_content_types:
4380+
if data_file_filter and data_file.content not in data_file_filter:
43834381
continue
43844382
column_sizes = data_file.column_sizes or {}
43854383
value_counts = data_file.value_counts or {}
@@ -4431,10 +4429,10 @@ def files(self, snapshot_id: Optional[int] = None) -> "pa.Table":
44314429
return self._files(snapshot_id)
44324430

44334431
def data_files(self, snapshot_id: Optional[int] = None) -> "pa.Table":
4434-
return self._files(snapshot_id, [DataFileContent.DATA])
4432+
return self._files(snapshot_id, {DataFileContent.DATA})
44354433

44364434
def delete_files(self, snapshot_id: Optional[int] = None) -> "pa.Table":
4437-
return self._files(snapshot_id, [DataFileContent.POSITION_DELETES, DataFileContent.EQUALITY_DELETES])
4435+
return self._files(snapshot_id, {DataFileContent.POSITION_DELETES, DataFileContent.EQUALITY_DELETES})
44384436

44394437

44404438
class _ManifestMergeManager(Generic[U]):

0 commit comments

Comments
 (0)