Skip to content

Commit 7f6bf9d

Browse files
committed
simplify return in snapshot.manifests
1 parent f200beb commit 7f6bf9d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pyiceberg/table/snapshots.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ def manifests(self, io: FileIO, content_filter: Optional[ManifestContent] = None
258258
io: The IO instance to read the manifest list.
259259
content_filter: The content filter to apply to the manifests. One of ManifestContent.DATA or ManifestContent.DELETES.
260260
"""
261-
all_manifests = list(_manifests(io, self.manifest_list))
262-
if content_filter is not None:
263-
all_manifests = [manifest for manifest in all_manifests if manifest.content == content_filter]
264-
265-
return all_manifests
261+
return [
262+
manifest
263+
for manifest in _manifests(io, self.manifest_list)
264+
if content_filter is None or manifest.content == content_filter
265+
]
266266

267267

268268
class MetadataLogEntry(IcebergBaseModel):

0 commit comments

Comments
 (0)