Skip to content

Flaky ExtensionArray tests #20468

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 Mar 23, 2018 · 0 comments · Fixed by #20469
Closed

Flaky ExtensionArray tests #20468

TomAugspurger opened this issue Mar 23, 2018 · 0 comments · Fixed by #20469
Labels
CI Continuous Integration Testing pandas testing functions or related to the test suite Unreliable Test Unit tests that occasionally fail
Milestone

Comments

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Mar 23, 2018

https://circleci.com/gh/pandas-dev/pandas/12793#tests/containers/3

=================================== FAILURES ===================================
___________________________ TestMethods.test_argsort ___________________________

self = <pandas.tests.extension.json.test_json.TestMethods object at 0x7f1c0e0997f0>
data_for_sorting = JSONArary([{'b': 1}, {'c': 4}, {'c': 3, 'a': 2}])

    @unstable
    def test_argsort(self, data_for_sorting):
>       super(TestMethods, self).test_argsort(data_for_sorting)

pandas/tests/extension/json/test_json.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/tests/extension/base/methods.py:38: in test_argsort
    self.assert_series_equal(result, expected)
pandas/util/testing.py:1218: in assert_series_equal
    obj='{obj}'.format(obj=obj))
pandas/_libs/testing.pyx:59: in pandas._libs.testing.assert_almost_equal
    cpdef assert_almost_equal(a, b,
pandas/_libs/testing.pyx:173: in pandas._libs.testing.assert_almost_equal
    raise_assert_detail(obj, msg, lobj, robj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = 'Series', message = 'Series values are different (66.66667 %)'
left = '[0, 2, 1]', right = '[2, 0, 1]', diff = None

    def raise_assert_detail(obj, message, left, right, diff=None):
        if isinstance(left, np.ndarray):
            left = pprint_thing(left)
        elif is_categorical_dtype(left):
            left = repr(left)
        if isinstance(right, np.ndarray):
            right = pprint_thing(right)
        elif is_categorical_dtype(right):
            right = repr(right)
    
        msg = """{obj} are different
    
    {message}
    [left]:  {left}
    [right]: {right}""".format(obj=obj, message=message, left=left, right=right)
    
        if diff is not None:
            msg += "\n[diff]: {diff}".format(diff=diff)
    
>       raise AssertionError(msg)
E       AssertionError: Series are different
E       
E       Series values are different (66.66667 %)
E       [left]:  [0, 2, 1]
E       [right]: [2, 0, 1]

pandas/util/testing.py:1009: AssertionError
______________________ TestMethods.test_sort_values[True] ______________________

self = <pandas.tests.extension.json.test_json.TestMethods object at 0x7f1c0e0ee2b0>
data_for_sorting = JSONArary([{'b': 1}, {'c': 4}, {'c': 3, 'a': 2}])
ascending = True

    @unstable
    @pytest.mark.parametrize('ascending', [True, False])
    def test_sort_values(self, data_for_sorting, ascending):
        super(TestMethods, self).test_sort_values(
>           data_for_sorting, ascending)

pandas/tests/extension/json/test_json.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/tests/extension/base/methods.py:53: in test_sort_values
    self.assert_series_equal(result, expected)
pandas/util/testing.py:1174: in assert_series_equal
    obj='{obj}.index'.format(obj=obj))
pandas/util/testing.py:843: in assert_index_equal
    obj=obj, lobj=left, robj=right)
pandas/_libs/testing.pyx:59: in pandas._libs.testing.assert_almost_equal
    cpdef assert_almost_equal(a, b,
pandas/_libs/testing.pyx:173: in pandas._libs.testing.assert_almost_equal
    raise_assert_detail(obj, msg, lobj, robj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = 'Series.index', message = 'Series.index values are different (66.66667 %)'
left = Int64Index([0, 2, 1], dtype='int64')
right = Int64Index([2, 0, 1], dtype='int64'), diff = None

    def raise_assert_detail(obj, message, left, right, diff=None):
        if isinstance(left, np.ndarray):
            left = pprint_thing(left)
        elif is_categorical_dtype(left):
            left = repr(left)
        if isinstance(right, np.ndarray):
            right = pprint_thing(right)
        elif is_categorical_dtype(right):
            right = repr(right)
    
        msg = """{obj} are different
    
    {message}
    [left]:  {left}
    [right]: {right}""".format(obj=obj, message=message, left=left, right=right)
    
        if diff is not None:
            msg += "\n[diff]: {diff}".format(diff=diff)
    
>       raise AssertionError(msg)
E       AssertionError: Series.index are different
E       
E       Series.index values are different (66.66667 %)
E       [left]:  Int64Index([0, 2, 1], dtype='int64')
E       [right]: Int64Index([2, 0, 1], dtype='int64')

pandas/util/testing.py:1009: AssertionError
_____________________ TestMethods.test_sort_values[False] ______________________

self = <pandas.tests.extension.json.test_json.TestMethods object at 0x7f1c0d8d3978>
data_for_sorting = JSONArary([{'b': 1}, {'c': 4}, {'c': 3, 'a': 2}])
ascending = False

    @unstable
    @pytest.mark.parametrize('ascending', [True, False])
    def test_sort_values(self, data_for_sorting, ascending):
        super(TestMethods, self).test_sort_values(
>           data_for_sorting, ascending)

pandas/tests/extension/json/test_json.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/tests/extension/base/methods.py:53: in test_sort_values
    self.assert_series_equal(result, expected)
pandas/util/testing.py:1174: in assert_series_equal
    obj='{obj}.index'.format(obj=obj))
pandas/util/testing.py:843: in assert_index_equal
    obj=obj, lobj=left, robj=right)
pandas/_libs/testing.pyx:59: in pandas._libs.testing.assert_almost_equal
    cpdef assert_almost_equal(a, b,
pandas/_libs/testing.pyx:173: in pandas._libs.testing.assert_almost_equal
    raise_assert_detail(obj, msg, lobj, robj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = 'Series.index', message = 'Series.index values are different (66.66667 %)'
left = Int64Index([1, 2, 0], dtype='int64')
right = Int64Index([1, 0, 2], dtype='int64'), diff = None

    def raise_assert_detail(obj, message, left, right, diff=None):
        if isinstance(left, np.ndarray):
            left = pprint_thing(left)
        elif is_categorical_dtype(left):
            left = repr(left)
        if isinstance(right, np.ndarray):
            right = pprint_thing(right)
        elif is_categorical_dtype(right):
            right = repr(right)
    
        msg = """{obj} are different
    
    {message}
    [left]:  {left}
    [right]: {right}""".format(obj=obj, message=message, left=left, right=right)
    
        if diff is not None:
            msg += "\n[diff]: {diff}".format(diff=diff)
    
>       raise AssertionError(msg)
E       AssertionError: Series.index are different
E       
E       Series.index values are different (66.66667 %)
E       [left]:  Int64Index([1, 2, 0], dtype='int64')
E       [right]: Int64Index([1, 0, 2], dtype='int64')

pandas/util/testing.py:1009: AssertionError
@TomAugspurger TomAugspurger added Testing pandas testing functions or related to the test suite CI Continuous Integration Unreliable Test Unit tests that occasionally fail labels Mar 23, 2018
@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Testing pandas testing functions or related to the test suite Unreliable Test Unit tests that occasionally fail
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant