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

test(schema): ensure that we attempt to call __arrow_c_schema__ #9671

Merged
merged 1 commit into from
Jul 23, 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
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 @@
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