Skip to content

Commit 8f5e9ad

Browse files
Address review nits: drop redundant ABC base, keep extracted bodies as faithful moves
- TableScan(BaseScan, ABC) -> TableScan(BaseScan): ABC is redundant since BaseScan already extends it. No behavioural change (identical MRO, ABCMeta metaclass, __abstractmethods__; TableScan stays non-instantiable). - ManifestGroupPlanner.plan_manifest_entries / plan_files: restore the baseline statement order and blank lines so the extracted bodies read as verbatim moves of DataScan.scan_plan_helper / _plan_files_local. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ecfa2fb commit 8f5e9ad

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

pyiceberg/table/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,7 @@ def to_polars(self) -> pl.DataFrame:
19071907
S = TypeVar("S", bound="TableScan", covariant=True)
19081908

19091909

1910-
class TableScan(BaseScan, ABC):
1910+
class TableScan(BaseScan):
19111911
"""A base class for table scans targeting a single snapshot."""
19121912

19131913
snapshot_id: int | None
@@ -2274,14 +2274,18 @@ def plan_manifest_entries(self, manifests: Iterable[ManifestFile]) -> Iterator[l
22742274
"""
22752275
# step 1: filter manifests using partition summaries
22762276
# the filter depends on the partition spec used to write the manifest file, so create a cache of filters for each spec id
2277+
22772278
manifest_evaluators: dict[int, Callable[[ManifestFile], bool]] = KeyDefaultDict(self._build_manifest_evaluator)
2279+
22782280
manifests = [
22792281
manifest_file for manifest_file in manifests if manifest_evaluators[manifest_file.partition_spec_id](manifest_file)
22802282
]
22812283

22822284
# step 2: filter the data files in each manifest
22832285
# this filter depends on the partition spec used to write the manifest file
2286+
22842287
partition_evaluators: dict[int, Callable[[DataFile], bool]] = KeyDefaultDict(self._build_partition_evaluator)
2288+
22852289
min_sequence_number = _min_sequence_number(manifests)
22862290

22872291
executor = ExecutorFactory.get_or_create()
@@ -2305,11 +2309,11 @@ def plan_files(self, manifests: Iterable[ManifestFile]) -> Iterable[FileScanTask
23052309
Returns:
23062310
List of FileScanTasks that contain both data and delete files.
23072311
"""
2308-
residual_evaluators: dict[int, Callable[[DataFile], ResidualEvaluator]] = KeyDefaultDict(self._build_residual_evaluator)
2309-
23102312
data_entries: list[ManifestEntry] = []
23112313
delete_index = DeleteFileIndex()
23122314

2315+
residual_evaluators: dict[int, Callable[[DataFile], ResidualEvaluator]] = KeyDefaultDict(self._build_residual_evaluator)
2316+
23132317
for manifest_entry in chain.from_iterable(self.plan_manifest_entries(manifests)):
23142318
data_file = manifest_entry.data_file
23152319
if data_file.content == DataFileContent.DATA:

0 commit comments

Comments
 (0)