Skip to content

CI: Failing NumpyDev #42381

Closed
Closed
@lithomas1

Description

@lithomas1

https://github.com/pandas-dev/pandas/runs/2985248923

=================================== FAILURES ===================================
__________ TestTimedeltaMultiplicationDivision.test_td_div_nan[nan1] ___________
[gw0] linux -- Python 3.9.5 /usr/share/miniconda/envs/pandas-dev/bin/python

self = <pandas.tests.scalar.timedelta.test_arithmetic.TestTimedeltaMultiplicationDivision object at 0x7f2d87ba9f40>
nan = nan

    @pytest.mark.parametrize(
        "nan",
        [
            np.nan,
            pytest.param(
                np.float64("NaN"),
                marks=pytest.mark.xfail(
                    # Works on numpy dev only in python 3.9
                    is_numpy_dev and not compat.PY39,
                    raises=RuntimeWarning,
                    reason="https://github.com/pandas-dev/pandas/issues/31992",
                ),
            ),
            float("nan"),
        ],
    )
    def test_td_div_nan(self, nan):
        # np.float64('NaN') has a 'dtype' attr, avoid treating as array
        td = Timedelta(10, unit="d")
        result = td / nan
        assert result is NaT
    
>       result = td // nan

pandas/tests/scalar/timedelta/test_arithmetic.py:455: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   return Timedelta(self.value // other, unit='ns')
E   RuntimeWarning: invalid value encountered in double_scalars

pandas/_libs/tslibs/timedeltas.pyx:1465: RuntimeWarning

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous IntegrationCompatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions