kaushiksrini commented on code in PR #2050: URL: https://github.com/apache/iceberg-python/pull/2050#discussion_r2119396683
########## pyiceberg/table/update/validate.py: ########## @@ -150,3 +151,54 @@ def _validate_deleted_data_files( if any(conflicting_entries): conflicting_snapshots = {entry.snapshot_id for entry in conflicting_entries} raise ValidationException(f"Deleted data files were found matching the filter for snapshots {conflicting_snapshots}!") + + +def _added_data_files( + table: Table, + starting_snapshot: Snapshot, + data_filter: Optional[BooleanExpression], + partition_set: Optional[dict[int, set[Record]]], + parent_snapshot: Optional[Snapshot], +) -> Iterator[ManifestEntry]: + if parent_snapshot is None: + return + + manifests, snapshot_ids = validation_history( + table, + parent_snapshot, + starting_snapshot, + VALIDATE_ADDED_FILES_OPERATIONS, + ManifestContent.DATA, + ) + + if data_filter is not None: + evaluator = _InclusiveMetricsEvaluator(table.schema(), data_filter) + + for manifest in manifests: + for entry in manifest.fetch_manifest_entry(table.io): + if entry.snapshot_id not in snapshot_ids: + continue + + if data_filter and evaluator.eval(entry.data_file) is ROWS_CANNOT_MATCH: Review Comment: good point! made some changes @sungwy -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org