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 authored and jcrist committed Jul 23, 2024
1 parent 105bec2 commit e59a54c
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()


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

0 comments on commit e59a54c

Please sign in to comment.