Skip to content

Commit 75ba28b

Browse files
sumedhsakdeoclaude
andcommitted
fix: remove isinstance guard that caused CI failures
Replace the defensive isinstance(order, ScanOrder) guard with the already-present isinstance(order, ArrivalOrder) branch logic. The guard was causing ValueError in CI due to a module-identity mismatch between the ScanOrder imported by pyarrow.py and the one used to subclass TaskOrder. The code is correct without it: ArrivalOrder takes the fast path, everything else falls through to TaskOrder (materialized) behavior. Type safety is provided statically by the annotation and _DEFAULT_SCAN_ORDER sentinel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 039e91b commit 75ba28b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,11 +1879,8 @@ def to_record_batches(
18791879
Raises:
18801880
ResolveError: When a required field cannot be found in the file
18811881
ValueError: When a field type in the file cannot be projected to the schema type,
1882-
or when an invalid order value is provided, or when concurrent_streams < 1.
1882+
or when concurrent_streams < 1.
18831883
"""
1884-
if not isinstance(order, ScanOrder):
1885-
raise ValueError(f"Invalid order: {order!r}. Must be a ScanOrder instance (TaskOrder() or ArrivalOrder()).")
1886-
18871884
task_list, deletes_per_file = self._prepare_tasks_and_deletes(tasks)
18881885

18891886
if isinstance(order, ArrivalOrder):

0 commit comments

Comments
 (0)