|
171 | 171 | from pyiceberg.utils.concurrent import ExecutorFactory |
172 | 172 | from pyiceberg.utils.config import Config |
173 | 173 | from pyiceberg.utils.datetime import millis_to_datetime |
| 174 | +from pyiceberg.utils.deprecated import deprecation_message |
174 | 175 | from pyiceberg.utils.properties import get_first_property_value, property_as_bool, property_as_int |
175 | 176 | from pyiceberg.utils.singleton import Singleton |
176 | 177 | from pyiceberg.utils.truncate import truncate_upper_bound_binary_string, truncate_upper_bound_text_string |
@@ -1515,8 +1516,12 @@ def __init__( |
1515 | 1516 | self._table_metadata = table_metadata |
1516 | 1517 | self._io = io |
1517 | 1518 | self._projected_schema = projected_schema |
1518 | | - # TBD: Should we deprecate the `row_filter` argument? |
1519 | 1519 | if row_filter is not None: |
| 1520 | + deprecation_message( |
| 1521 | + deprecated_in="0.9.0", |
| 1522 | + removed_in="0.10.0", |
| 1523 | + help_message="row_filter is marked as deprecated, and will be removed in 0.10.0. Please make sure to set the residual on the ScanTasks.", |
| 1524 | + ) |
1520 | 1525 | self._bound_row_filter = bind(table_metadata.schema(), row_filter, case_sensitive=case_sensitive) |
1521 | 1526 | else: |
1522 | 1527 | self._bound_row_filter = None |
@@ -1552,7 +1557,7 @@ def to_table(self, tasks: Iterable[FileScanTask]) -> pa.Table: |
1552 | 1557 | executor = ExecutorFactory.get_or_create() |
1553 | 1558 |
|
1554 | 1559 | if self._bound_row_filter is not None: |
1555 | | - tasks = [task.set_residual(expr=self._bound_row_filter) for task in tasks] |
| 1560 | + tasks = [task._set_residual(expr=self._bound_row_filter) for task in tasks] |
1556 | 1561 |
|
1557 | 1562 | def _table_from_scan_task(task: FileScanTask) -> Optional[pa.Table]: |
1558 | 1563 | batches = list(self._record_batches_from_scan_tasks_and_deletes([task], deletes_per_file)) |
@@ -1615,7 +1620,7 @@ def to_record_batches(self, tasks: Iterable[FileScanTask]) -> Iterator[pa.Record |
1615 | 1620 | ValueError: When a field type in the file cannot be projected to the schema type |
1616 | 1621 | """ |
1617 | 1622 | if self._bound_row_filter is not None: |
1618 | | - tasks = [task.set_residual(expr=self._bound_row_filter) for task in tasks] |
| 1623 | + tasks = [task._set_residual(expr=self._bound_row_filter) for task in tasks] |
1619 | 1624 |
|
1620 | 1625 | deletes_per_file = _read_all_delete_files(self._io, tasks) |
1621 | 1626 | return self._record_batches_from_scan_tasks_and_deletes(tasks, deletes_per_file) |
|
0 commit comments