Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #254 from scikit-hep/jpivarski/adapt-to-pyarrow-1.0
Browse files Browse the repository at this point in the history
Skip tests involving unions because pyarrow 1.0.0 has changed their interface.
  • Loading branch information
jpivarski authored Aug 8, 2020
2 parents 2bbdb68 + 825a0a2 commit 15a63d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,41 +269,47 @@ def test_arrow_null_nested_strings_null(self):
a = pyarrow.array([["one", "two", None], [], None, ["four", "five"]])
assert awkward.arrow.fromarrow(a).tolist() == [["one", "two", None], [], None, ["four", "five"]]

@pytest.mark.skip(reason="pyarrow API changed for unions")
def test_arrow_union_sparse(self):
if pyarrow is None:
pytest.skip("unable to import pyarrow")
else:
a = pyarrow.UnionArray.from_sparse(pyarrow.array([0, 1, 0, 0, 1], type=pyarrow.int8()), [pyarrow.array([0.0, 1.1, 2.2, 3.3, 4.4]), pyarrow.array([True, True, False, True, False])])
assert awkward.arrow.fromarrow(a).tolist() == [0.0, True, 2.2, 3.3, False]

@pytest.mark.skip(reason="pyarrow API changed for unions")
def test_arrow_union_sparse_null(self):
if pyarrow is None:
pytest.skip("unable to import pyarrow")
else:
a = pyarrow.UnionArray.from_sparse(pyarrow.array([0, 1, 0, 0, 1], type=pyarrow.int8()), [pyarrow.array([0.0, 1.1, None, 3.3, 4.4]), pyarrow.array([True, True, False, True, False])])
assert awkward.arrow.fromarrow(a).tolist() == [0.0, True, None, 3.3, False]

@pytest.mark.skip(reason="pyarrow API changed for unions")
def test_arrow_union_sparse_null_null(self):
if pyarrow is None:
pytest.skip("unable to import pyarrow")
else:
a = pyarrow.UnionArray.from_sparse(pyarrow.array([0, 1, 0, 0, 1], type=pyarrow.int8()), [pyarrow.array([0.0, 1.1, None, 3.3, 4.4]), pyarrow.array([True, None, False, True, False])])
assert awkward.arrow.fromarrow(a).tolist() == [0.0, None, None, 3.3, False]

@pytest.mark.skip(reason="pyarrow API changed for unions")
def test_arrow_union_dense(self):
if pyarrow is None:
pytest.skip("unable to import pyarrow")
else:
a = pyarrow.UnionArray.from_dense(pyarrow.array([0, 1, 0, 0, 0, 1, 1], type=pyarrow.int8()), pyarrow.array([0, 0, 1, 2, 3, 1, 2], type=pyarrow.int32()), [pyarrow.array([0.0, 1.1, 2.2, 3.3]), pyarrow.array([True, True, False])])
assert awkward.arrow.fromarrow(a).tolist() == [0.0, True, 1.1, 2.2, 3.3, True, False]

@pytest.mark.skip(reason="pyarrow API changed for unions")
def test_arrow_union_dense_null(self):
if pyarrow is None:
pytest.skip("unable to import pyarrow")
else:
a = pyarrow.UnionArray.from_dense(pyarrow.array([0, 1, 0, 0, 0, 1, 1], type=pyarrow.int8()), pyarrow.array([0, 0, 1, 2, 3, 1, 2], type=pyarrow.int32()), [pyarrow.array([0.0, 1.1, None, 3.3]), pyarrow.array([True, True, False])])
assert awkward.arrow.fromarrow(a).tolist() == [0.0, True, 1.1, None, 3.3, True, False]

@pytest.mark.skip(reason="pyarrow API changed for unions")
def test_arrow_union_dense_null_null(self):
if pyarrow is None:
pytest.skip("unable to import pyarrow")
Expand Down

0 comments on commit 15a63d5

Please sign in to comment.