From ab32acccef34e0b1861ec07a4d8e6194085e37bc Mon Sep 17 00:00:00 2001 From: yangjie01 Date: Wed, 17 Jun 2026 21:17:11 +0800 Subject: [PATCH] refactor: collapse redundant branch in add_columns_from transform The elif (pa.Table | dict) and else arms in _wrap_transform both assigned new_cols = result, so the isinstance check was dead. Collapse to a single else. --- lance_ray/io.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lance_ray/io.py b/lance_ray/io.py index 270ab287..dd093c6f 100644 --- a/lance_ray/io.py +++ b/lance_ray/io.py @@ -799,9 +799,8 @@ def _wrap_transform(batch: pa.Table) -> pa.Table: result = transform(batch_dict) if isinstance(result, pa.RecordBatch): new_cols = pa.Table.from_batches([result]) - elif isinstance(result, pa.Table | dict): - new_cols = result else: + # Already a pa.Table or dict (normalized below). new_cols = result else: reader = pa.RecordBatchReader.from_batches(