Skip to content

[Python] test_asarray and test_chunked_array_asarray never run due to mark pandas+nopandas #55486

Open

Description

@tadeja

Describe the bug, including details regarding any error messages, version, and platform.

pyarrow/tests/test_array.py::test_asarray is decorated with both:

@pytest.mark.nopandas
@pytest.mark.pandas
def test_asarray():

So the test never runs.
Discovered in #55264 (comment)

Similarly for pyarrow/tests/test_table.py::test_chunked_array_asarray

@pytest.mark.pandas
@pytest.mark.nopandas
def test_chunked_array_asarray():
# ensure this is tested both when pandas is present or not (ARROW-6564)

Component(s)

Python

Activity

  1. 09Catho commented on Nov 11, 2026

    @09Catho
    Contributor

    Removing the marks alone isn't enough, because the body is stale and fails once it runs. I copied the test body out without the marks and ran it against the released wheel (pyarrow 26.0.1, numpy 2.4.6, pandas 3.1.1), not a build of main. The first block fails:

    E       assert [<pyarrow.Int...t64Scalar: 3>] == [0, 1, 2, 3]
    E         At index 0 diff: <pyarrow.Int64Scalar: 0> != 0
    

    Iterating the array yields Int64Scalar objects, so np.asarray([_ for _ in arr]).tolist() returns scalars, not ints. With that assertion changed to [x.as_py() for x in np_arr] == [0, 1, 2, 3] and the isinstance check changed to pa.Int64Scalar, the test passes. The rest of the body passes unchanged.

    #55264 edits the same lines (Int64Value to Int64Scalar) but keeps the tolist() assertion, so that line would still fail once the marks are fixed. I haven't opened a separate PR because it would overlap with #55264. If you'd rather review it on its own, I can send one with the marker fix too (drop pandas/nopandas, add numpy).

  2. added a commit that references this issue on Nov 13, 2026
  3. tadeja commented on Nov 23, 2026

    @tadeja
    MemberAuthor

    @AFOliveira could you post here, so I'd assign this issue to you?

  4. changed the title [-][Python] test_asarray never runs due to conflicting mark pandas+nopandas[/-] [+][Python] test_asarray and test_chunked_array_asarray never run due to mark pandas+nopandas[/+] on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions