Skip to content

CI/TST: Fix xfail(strict=False) condition #46150

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

Merged
merged 2 commits into from
Feb 25, 2022

Conversation

mroeschke
Copy link
Member

cc @jbrockmendel For this example, the monotonic condition was too strict

In [1]: index_flat = Index([True, True, True, True, True, True, True, True, False, False], dtype='bool')

In [2]: index_flat2 = pd.Int64Index([0, 0, 1, 1, 2, 2], dtype='int64')
<ipython-input-2-0cd74eb77800>:1: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
  index_flat2 = pd.Int64Index([0, 0, 1, 1, 2, 2], dtype='int64')

In [3]: idx1 = index_flat

In [4]: idx2 = index_flat2

In [5]: (
   ...:             not idx1.is_unique
   ...:             and not idx2.is_unique
   ...:             and not idx2.is_monotonic_decreasing
   ...:             and idx1.dtype.kind == "i"
   ...:             and idx2.dtype.kind == "b"
   ...:         )
Out[5]: False

In [6]: (
   ...:             not idx2.is_unique
   ...:             and not idx1.is_unique
   ...:             and not idx1.is_monotonic_decreasing
   ...:             and idx2.dtype.kind == "i"
   ...:             and idx1.dtype.kind == "b"
   ...:         )
Out[6]: False

@mroeschke mroeschke added CI Continuous Integration Unreliable Test Unit tests that occasionally fail labels Feb 25, 2022
@mroeschke mroeschke added this to the 1.4.2 milestone Feb 25, 2022
@@ -50,13 +50,11 @@ def test_union_different_types(index_flat, index_flat2, request):
if (
not idx1.is_unique
and not idx2.is_unique
and not idx2.is_monotonic_decreasing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could add a comment pointing back here to the effect of "not idx2.is_monotonic_decreasing covers most cases but is too strict"

Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mroeschke mroeschke modified the milestones: 1.4.2, 1.5 Feb 25, 2022
@mroeschke mroeschke merged commit 1f0c547 into pandas-dev:main Feb 25, 2022
@mroeschke mroeschke deleted the ci/flaky_test branch February 25, 2022 21:38
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
* CI/TST: Fix xfail(strict=False) condition

* add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Unreliable Test Unit tests that occasionally fail
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants