You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Fokko (via GitHub)" <gi...@apache.org> on 2023/02/01 13:55:44 UTC
[GitHub] [iceberg] Fokko commented on a diff in pull request #6657: Python: Allow to pass in a string as filter
Fokko commented on code in PR #6657:
URL: https://github.com/apache/iceberg/pull/6657#discussion_r1093256570
##########
python/pyiceberg/table/__init__.py:
##########
@@ -183,14 +185,17 @@ class TableScan(Generic[S], ABC):
def __init__(
self,
table: Table,
- row_filter: Optional[BooleanExpression] = None,
+ row_filter: Optional[Union[str, BooleanExpression]] = None,
selected_fields: Tuple[str] = ("*",),
case_sensitive: bool = True,
snapshot_id: Optional[int] = None,
options: Properties = EMPTY_DICT,
):
self.table = table
- self.row_filter = row_filter or AlwaysTrue()
+ if row_filter is None:
+ self.row_filter = AlwaysTrue()
+ else:
Review Comment:
We also do the same logic in the `filter()` method below, therefore I added it to the parse. But I agree, it will clutter up the parse method in the long run.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org