Skip to content

Commit afa1cd3

Browse files
committed
fix(catalog): avoid truthiness check on request filter in rest scan planning
Signed-off-by: Sami Chergui <83331159+Yshuro@users.noreply.github.com>
1 parent 1356f62 commit afa1cd3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎pyiceberg/catalog/rest/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def _plan_scan_result(self, identifier: str | Identifier, request: PlanTableScan
904904
if not isinstance(response, PlanCompleted):
905905
raise RuntimeError(f"Invalid planStatus for response: {type(response).__name__}")
906906

907-
tasks = self._expand_plan_tasks(identifier, response, request.filter or AlwaysTrue())
907+
tasks = self._expand_plan_tasks(identifier, response, request.filter if request.filter is not None else AlwaysTrue())
908908
return PlannedScanResult(
909909
tasks=tasks,
910910
storage_credentials=list(response.storage_credentials or []),

‎tests/io/test_pyarrow.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ def _set_spec_id(datafile: DataFile) -> DataFile:
12591259
),
12601260
io=PyArrowFileIO(),
12611261
projected_schema=schema,
1262-
row_filter=expr or AlwaysTrue(),
1262+
row_filter=expr if expr is not None else AlwaysTrue(),
12631263
case_sensitive=True,
12641264
).to_table(
12651265
tasks=[

0 commit comments

Comments
 (0)