Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Make test_empty_categorical_query work with TileDB<2.21 #2308

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions apis/python/tests/test_experiment_query.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from concurrent import futures
from contextlib import nullcontext
from typing import Tuple
from unittest import mock

import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import tiledb
from pyarrow import ArrowInvalid
from scipy import sparse
from somacore import AxisQuery, options

Expand Down Expand Up @@ -917,5 +920,12 @@ def test_empty_categorical_query(pbmc_small):
q = pbmc_small.axis_query(
measurement_name="RNA", obs_query=AxisQuery(value_filter='groups == "foo"')
)
obs = q.obs().concat()
assert len(obs) == 0
# Empty query on a categorical column raised ArrowInvalid before TileDB 2.21; see https://github.com/single-cell-data/TileDB-SOMA/pull/2299
ctx = (
nullcontext()
if tiledb.libtiledb.version() >= (2, 21)
else pytest.raises(ArrowInvalid)
)
with ctx:
obs = q.obs().concat()
assert len(obs) == 0
Loading