4545from sortedcontainers import SortedList
4646from typing_extensions import Annotated
4747
48+ import pyiceberg .expressions .parser as parser
49+ import pyiceberg .expressions .visitors as visitors
4850from pyiceberg .exceptions import CommitFailedException , ResolveError , ValidationError
4951from pyiceberg .expressions import (
5052 AlwaysTrue ,
5153 And ,
5254 BooleanExpression ,
5355 EqualTo ,
54- parser ,
55- visitors ,
5656)
57- from pyiceberg .expressions .visitors import _InclusiveMetricsEvaluator , inclusive_projection
5857from pyiceberg .io import FileIO , load_file_io
5958from pyiceberg .manifest import (
6059 POSITIONAL_DELETE_SCHEMA ,
@@ -1293,7 +1292,9 @@ def _match_deletes_to_data_file(data_entry: ManifestEntry, positional_delete_ent
12931292 relevant_entries = positional_delete_entries [positional_delete_entries .bisect_right (data_entry ) :]
12941293
12951294 if len (relevant_entries ) > 0 :
1296- evaluator = _InclusiveMetricsEvaluator (POSITIONAL_DELETE_SCHEMA , EqualTo ("file_path" , data_entry .data_file .file_path ))
1295+ evaluator = visitors ._InclusiveMetricsEvaluator (
1296+ POSITIONAL_DELETE_SCHEMA , EqualTo ("file_path" , data_entry .data_file .file_path )
1297+ )
12971298 return {
12981299 positional_delete_entry .data_file
12991300 for positional_delete_entry in relevant_entries
@@ -1317,7 +1318,7 @@ def __init__(
13171318 super ().__init__ (table , row_filter , selected_fields , case_sensitive , snapshot_id , options , limit )
13181319
13191320 def _build_partition_projection (self , spec_id : int ) -> BooleanExpression :
1320- project = inclusive_projection (self .table .schema (), self .table .specs ()[spec_id ])
1321+ project = visitors . inclusive_projection (self .table .schema (), self .table .specs ()[spec_id ])
13211322 return project (self .row_filter )
13221323
13231324 @cached_property
@@ -1384,7 +1385,7 @@ def plan_files(self) -> Iterable[FileScanTask]:
13841385 # this filter depends on the partition spec used to write the manifest file
13851386
13861387 partition_evaluators : Dict [int , Callable [[DataFile ], bool ]] = KeyDefaultDict (self ._build_partition_evaluator )
1387- metrics_evaluator = _InclusiveMetricsEvaluator (
1388+ metrics_evaluator = visitors . _InclusiveMetricsEvaluator (
13881389 self .table .schema (), self .row_filter , self .case_sensitive , self .options .get ("include_empty_files" ) == "true"
13891390 ).eval
13901391
0 commit comments