Skip to content

Commit c407e12

Browse files
author
Hanzhi Wang
committed
Use chain.from_iterable
1 parent 1bb6772 commit c407e12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyiceberg/table/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,7 @@ def plan_files(self) -> Iterable[FileScanTask]:
19981998

19991999
residual_evaluators: Dict[int, Callable[[DataFile], ResidualEvaluator]] = KeyDefaultDict(self._build_residual_evaluator)
20002000

2001-
for manifest_entry in chain(*self.scan_plan_helper()):
2001+
for manifest_entry in chain.from_iterable(self.scan_plan_helper()):
20022002
data_file = manifest_entry.data_file
20032003
if data_file.content == DataFileContent.DATA:
20042004
data_entries.append(manifest_entry)

pyiceberg/table/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def partitions(
310310

311311
partitions_map: Dict[Tuple[str, Any], Any] = {}
312312

313-
for entry in itertools.chain(*scan.scan_plan_helper()):
313+
for entry in itertools.chain.from_iterable(scan.scan_plan_helper()):
314314
partition = entry.data_file.partition
315315
partition_record_dict = {
316316
field.name: partition[pos] for pos, field in enumerate(self.tbl.metadata.specs()[entry.data_file.spec_id].fields)

0 commit comments

Comments
 (0)