Debian Bug report logs - #1094417
pandas: test_frame_setitem_dask_array_into_new_col fails

Packages: python3-dask, python3-pandas; Maintainer for python3-dask is Debian Python Team <[email protected]>; Source for python3-dask is src:dask (PTS, buildd, popcon). Maintainer for python3-pandas is Debian Science Team <[email protected]>; Source for python3-pandas is src:pandas (PTS, buildd, popcon).

Reported by: "Rebecca N. Palmer" <[email protected]>

Date: Mon, 27 Jan 2025 23:27:01 UTC

Severity: normal

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian Science Team <[email protected]>, Debian Python Team <[email protected]>:
Bug#1094417; Package python3-pandas,python3-dask. (Mon, 27 Jan 2025 23:27:01 GMT) (full text, mbox, link).


Acknowledgement sent to "Rebecca N. Palmer" <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian Science Team <[email protected]>, Debian Python Team <[email protected]>.

Your message had a Version: pseudo-header with an invalid package version:

2.2.3+dfsg-6,2024.12.1+dfsg-1

please either use found or fixed to the control server with a correct version, or reply to this report indicating the correct version so the maintainer (or someone else) can correct it for you.

(Mon, 27 Jan 2025 23:27:02 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: "Rebecca N. Palmer" <[email protected]>
To: [email protected]
Subject: pandas: test_frame_setitem_dask_array_into_new_col fails
Date: Mon, 27 Jan 2025 23:22:35 +0000
Package: python3-pandas,python3-dask
Version: 2.2.3+dfsg-6,2024.12.1+dfsg-1

The pandas test test_frame_setitem_dask_array_into_new_col is failing in 
Salsa; it looks like assigning a dask array to a DataFrame used to make 
a copy and now does not.

I'm not sure yet whether this is an actual problem - I'm mostly opening 
this bug so I don't forget about it.

__________________ test_frame_setitem_dask_array_into_new_col 
__________________

    @pytest.mark.xfail(
        condition=not IS64,
        reason="dask has different nativesize-int vs int64 type rules",
        strict=False,
    )
    def test_frame_setitem_dask_array_into_new_col():
        # GH#47128

        # dask sets "compute.use_numexpr" to False, so catch the 
current value
        # and ensure to reset it afterwards to avoid impacting other tests
        olduse = pd.get_option("compute.use_numexpr")

        try:
            da = td.versioned_importorskip("dask.array")

            dda = da.array([1, 2])
            df = DataFrame({"a": ["a", "b"]})
            df["b"] = dda
            df["c"] = dda
            df.loc[[False, True], "b"] = 100
            result = df.loc[[1], :]
            expected = DataFrame({"a": ["b"], "b": [100], "c": [2]}, 
index=[1])
>           tm.assert_frame_equal(result, expected)

pandas/tests/test_downstream.py:259:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _

left = array([100]), right = array([2]), err_msg = None

    def _raise(left, right, err_msg) -> NoReturn:
        if err_msg is None:
            if left.shape != right.shape:
                raise_assert_detail(
                    obj, f"{obj} shapes are different", left.shape, 
right.shape
                )

            diff = 0
            for left_arr, right_arr in zip(left, right):
                # count up differences
                if not array_equivalent(left_arr, right_arr, 
strict_nan=strict_nan):
                    diff += 1

            diff = diff * 100.0 / left.size
            msg = f"{obj} values are different ({np.round(diff, 5)} %)"
>           raise_assert_detail(obj, msg, left, right, 
index_values=index_values)
E           AssertionError: DataFrame.iloc[:, 2] (column name="c") are 
different
E
E           DataFrame.iloc[:, 2] (column name="c") values are different 
(100.0 %)
E           [index]: [1]
E           [left]:  [100]
E           [right]: [2]

pandas/_testing/asserters.py:684: AssertionError



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 05:09:21 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.