Fokko commented on code in PR #3816:
URL: https://github.com/apache/iceberg-python/pull/3816#discussion_r3907460110
##########
pyiceberg/table/__init__.py:
##########
@@ -314,11 +314,19 @@ def _apply(
return self
- def _scan(self, row_filter: str | BooleanExpression = ALWAYS_TRUE,
case_sensitive: bool = True) -> DataScan:
- """Minimal data scan of the table with the current state of the
transaction."""
- return DataScan(
+ def _scan(
+ self,
+ row_filter: str | BooleanExpression = ALWAYS_TRUE,
+ case_sensitive: bool = True,
+ branch: str | None = None,
+ ) -> DataScan:
+ """Minimal data scan of the current transaction state, optionally
scoped to a branch."""
+ scan = DataScan(
table_metadata=self.table_metadata, io=self._table.io,
row_filter=row_filter, case_sensitive=case_sensitive
)
+ if branch in self.table_metadata.refs:
+ return scan.use_ref(branch)
Review Comment:
What about adding `ref` to the constructor?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]