Skip to content

Commit

Permalink
test: fix array, string and uuid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Feb 1, 2024
1 parent 04cd294 commit 55e3b03
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
18 changes: 8 additions & 10 deletions ibis/backends/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def test_array_contains(backend, con):
param(
[[1], [], [42, 42], []],
[-1, -1, 0, -1],
id="including-empty-array",
id="some-empty",
marks=[
pytest.mark.notyet(
["flink"],
Expand All @@ -593,22 +593,20 @@ def test_array_contains(backend, con):
param(
[[1], [1], [42, 42], [1]],
[-1, -1, 0, -1],
id="all-non-empty-arrays",
),
param(
[[1], [1, 42], [42, 42, 42], [42, 1]],
[-1, 1, 0, 0],
id="all-non-empty-arrays-2",
id="none-empty",
),
],
)
@pytest.mark.notimpl(["dask", "impala", "polars"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["dask", "polars"], raises=com.OperationNotDefinedError)
@pytest.mark.notyet(["impala"], raises=com.UnsupportedBackendType)
def test_array_position(backend, con, a, expected_array):
t = ibis.memtable({"a": a})
expr = t.a.index(42)
result = con.execute(expr)
expected = pd.Series(expected_array, dtype="object")
backend.assert_series_equal(result, expected, check_names=False, check_dtype=False)
assert frozenset(map(tuple, result.values)) == frozenset(
map(tuple, expected.values)
)


@builtin_array
Expand All @@ -635,7 +633,7 @@ def test_array_position(backend, con, a, expected_array):
param([[3, 2], [2], [42, 2], [2, 2], [2]], id="all-non-empty-arrays"),
],
)
def test_array_remove(backend, con, a):
def test_array_remove(con, a):
t = ibis.memtable({"a": a})
expr = t.a.remove(2)
result = con.execute(expr)
Expand Down
6 changes: 1 addition & 5 deletions ibis/backends/tests/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,14 +941,10 @@ def test_capitalize(con):
"mssql",
"mysql",
"exasol",
"impala",
],
raises=com.OperationNotDefinedError,
)
@pytest.mark.notimpl(
["impala"],
raises=com.UnsupportedBackendType,
reason="no array support",
)
def test_array_string_join(con):
s = ibis.array(["a", "b", "c"])
expected = "a,b,c"
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/tests/test_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
raises=sqlalchemy.exc.InternalError,
reason="Feature is not yet implemented: unsupported data type: UUID",
)
@pytest.mark.notimpl(["impala", "polars"], raises=NotImplementedError)
@pytest.mark.notimpl(["polars"], raises=NotImplementedError)
@pytest.mark.notimpl(["datafusion"], raises=Exception)
def test_uuid_literal(con, backend):
backend_name = backend.name()
Expand Down

0 comments on commit 55e3b03

Please sign in to comment.