Skip to content

Commit

Permalink
Change error raised for not-implemented feature. Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
westonpace committed Sep 18, 2024
1 parent 868f5b6 commit 0df1d97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion python/python/lance/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _filtered_efficient_sample(
if len(columns) == 1 and filter.lower() == f"{columns[0]} is not null":
table = pc.drop_null(table)
elif filter is not None:
raise Exception(f"Can't yet run filter <{filter}> in-memory")
raise NotImplementedError(f"Can't yet run filter <{filter}> in-memory")
if table.num_rows > 0:
tables.append(table)
remaining_rows -= table.num_rows
Expand Down
18 changes: 10 additions & 8 deletions python/python/tests/torch_tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,16 @@ def check(dataset):
)
)

# sampling fails
with pytest.raises(ValueError):
LanceDataset(
ds,
batch_size=10,
filter="ids >= 300",
samples=100,
columns=["ids"],
# sampling with filter
with pytest.raises(NotImplementedError):
check(
LanceDataset(
ds,
batch_size=10,
filter="ids >= 300",
samples=100,
columns=["ids"],
)
)


Expand Down

0 comments on commit 0df1d97

Please sign in to comment.