feat(python): add to_polars to AsyncQueryBase (#1986)

Fixes https://github.com/lancedb/lancedb/issues/1952

Added `to_polars` method to `AsyncQueryBase`.
This commit is contained in:
Takahiro Ebato
2025-01-07 02:35:28 +09:00
committed by GitHub
parent 8b31540b21
commit 2c05ffed52
2 changed files with 35 additions and 0 deletions

View File

@@ -400,6 +400,15 @@ async def test_query_to_pandas_async(table_async: AsyncTable):
assert df.shape == (0, 4)
@pytest.mark.asyncio
async def test_query_to_polars_async(table_async: AsyncTable):
df = await table_async.query().to_polars()
assert df.shape == (2, 4)
df = await table_async.query().where("id < 0").to_polars()
assert df.shape == (0, 4)
@pytest.mark.asyncio
async def test_none_query(table_async: AsyncTable):
with pytest.raises(ValueError):