Skip to content

Commit caa079e

Browse files
sumedhsakdeoclaude
andcommitted
Fix ruff B008: use module-level singleton for default ScanOrder
Replace TaskOrder() function call in argument default with a module-level singleton _DEFAULT_SCAN_ORDER to satisfy ruff B008 (no function calls in argument defaults). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1c73ea4 commit caa079e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,9 @@ def worker(task: FileScanTask) -> None:
17551755
break
17561756

17571757

1758+
_DEFAULT_SCAN_ORDER: ScanOrder = TaskOrder()
1759+
1760+
17581761
class ArrowScan:
17591762
_table_metadata: TableMetadata
17601763
_io: FileIO
@@ -1837,7 +1840,7 @@ def to_table(self, tasks: Iterable[FileScanTask]) -> pa.Table:
18371840
def to_record_batches(
18381841
self,
18391842
tasks: Iterable[FileScanTask],
1840-
order: ScanOrder = TaskOrder(),
1843+
order: ScanOrder = _DEFAULT_SCAN_ORDER,
18411844
) -> Iterator[pa.RecordBatch]:
18421845
"""Scan the Iceberg table and return an Iterator[pa.RecordBatch].
18431846

0 commit comments

Comments
 (0)