diff --git a/python/lancedb/table.py b/python/lancedb/table.py index 359985f1..2fe3ce9c 100644 --- a/python/lancedb/table.py +++ b/python/lancedb/table.py @@ -102,7 +102,8 @@ def _to_record_batch_generator( table = _sanitize_data(batch, schema, metadata, on_bad_vectors, fill_value) for batch in table.to_batches(): yield batch - yield batch + else: + yield batch class Table(ABC): diff --git a/python/tests/test_db.py b/python/tests/test_db.py index cfe2c06b..2800038a 100644 --- a/python/tests/test_db.py +++ b/python/tests/test_db.py @@ -143,6 +143,7 @@ def test_ingest_iterator(tmp_path): tbl_len = len(tbl) tbl.add(make_batches()) + assert tbl_len == 50 assert len(tbl) == tbl_len * 2 assert len(tbl.list_versions()) == 3 db.drop_database()