Skip to content

Commit

Permalink
test(schema): ensure that we attempt to call __arrow_c_schema__
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jul 23, 2024
1 parent 105bec2 commit 663a9aa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ibis/expr/tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,15 @@ def test_schema_from_to_pyarrow_schema():
assert restored_schema == pyarrow_schema


@pytest.mark.xfail(
raises=TypeError,
reason="pyarrow doesn't support Mappings that implement the `__arrow_c_schema__` method",
)
def test_schema___arrow_c_schema__():
pytest.importorskip("pyarrow")
pa = pytest.importorskip("pyarrow")
schema = sch.Schema({"a": dt.int64, "b": dt.string, "c": dt.boolean})
# smoketest, since no way to create schema from capsule in current pyarrow
assert schema.__arrow_c_schema__() is not None
pa_schema = pa.schema(schema)
assert pa_schema == schema.to_pyarrow()

Check warning on line 404 in ibis/expr/tests/test_schema.py

View check run for this annotation

Codecov / codecov/patch

ibis/expr/tests/test_schema.py#L404

Added line #L404 was not covered by tests


@pytest.mark.parametrize("lazy", [False, True])
Expand Down

0 comments on commit 663a9aa

Please sign in to comment.