Skip to content

CI: master failing windows py37_np141 builds #27902

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

Closed
TomAugspurger opened this issue Aug 13, 2019 · 6 comments · Fixed by #27956
Closed

CI: master failing windows py37_np141 builds #27902

TomAugspurger opened this issue Aug 13, 2019 · 6 comments · Fixed by #27956

Comments

@TomAugspurger
Copy link
Contributor

e.g https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=15921

================================== FAILURES ===================================
______________________________ test_apply[True] _______________________________
[gw1] win32 -- Python 3.7.4 C:\Miniconda\envs\pandas-dev\python.exe

ordered = True

    @pytest.mark.parametrize("ordered", [True, False])
    def test_apply(ordered):
        # GH 10138
    
        dense = Categorical(list("abc"), ordered=ordered)
    
        # 'b' is in the categories but not in the list
        missing = Categorical(list("aaa"), categories=["a", "b"], ordered=ordered)
        values = np.arange(len(dense))
        df = DataFrame({"missing": missing, "dense": dense, "values": values})
        grouped = df.groupby(["missing", "dense"], observed=True)
    
        # missing category 'b' should still exist in the output index
        idx = MultiIndex.from_arrays([missing, dense], names=["missing", "dense"])
        expected = DataFrame([0, 1, 2.0], index=idx, columns=["values"])
    
        result = grouped.apply(lambda x: np.mean(x))
>       assert_frame_equal(result, expected)
E       AssertionError: DataFrame are different
E       
E       DataFrame shape mismatch
E       [left]:  (3, 3)
E       [right]: (3, 1)

pandas\tests\groupby\test_categorical.py:228: AssertionError
______________________________ test_apply[False] ______________________________
[gw1] win32 -- Python 3.7.4 C:\Miniconda\envs\pandas-dev\python.exe

ordered = False

    @pytest.mark.parametrize("ordered", [True, False])
    def test_apply(ordered):
        # GH 10138
    
        dense = Categorical(list("abc"), ordered=ordered)
    
        # 'b' is in the categories but not in the list
        missing = Categorical(list("aaa"), categories=["a", "b"], ordered=ordered)
        values = np.arange(len(dense))
        df = DataFrame({"missing": missing, "dense": dense, "values": values})
        grouped = df.groupby(["missing", "dense"], observed=True)
    
        # missing category 'b' should still exist in the output index
        idx = MultiIndex.from_arrays([missing, dense], names=["missing", "dense"])
        expected = DataFrame([0, 1, 2.0], index=idx, columns=["values"])
    
        result = grouped.apply(lambda x: np.mean(x))
>       assert_frame_equal(result, expected)
E       AssertionError: DataFrame are different
E       
E       DataFrame shape mismatch
E       [left]:  (3, 3)
E       [right]: (3, 1)

pandas\tests\groupby\test_categorical.py:228: AssertionError
@charlesdong1991
Copy link
Member

charlesdong1991 commented Aug 13, 2019

ahh, i also see this error in my PR and i spent quite time debugging where PR went wrong, i thought it was my change that failed the check... I am actually about to ask how to only test code on windows environment because it passes checks on my laptop :) thanks for opening the issue! ^^

@TomAugspurger
Copy link
Contributor Author

It seems to be a flaky test, if you push to your PR again then it may pass.

@TomAugspurger
Copy link
Contributor Author

I set up a windows VM and was able to reproduce the failures occasionally. Trying out #27909.

@TomAugspurger
Copy link
Contributor Author

#27909 doesn't fix it :/

@TomAugspurger
Copy link
Contributor Author

Very strange.

Screen Shot 2019-08-16 at 2 07 17 PM

We have res = f(group), where f is (AFAICT) lambda x: np.mean(x).

I have no idea what's going on.

Given that it's an only observed on older NumPy's (right?) maybe we just skip for NumPy 1.14?

TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Aug 16, 2019
@TomAugspurger
Copy link
Contributor Author

TomAugspurger commented Aug 16, 2019

xref #21636 too.

TomAugspurger added a commit that referenced this issue Aug 16, 2019
* TST: xfail on 37, win

Closes #27902
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants