Skip to content

docstring tests are broken with pandas 3.0.3 / numpy 2.4.6 #305

Description

@hugobuddel

Running the testsuite with pandas 3.0.3 / numpy 2.4.6 gives this error:

===== FAILURES =====
_____ [doctest] upsetplot.data.from_indicators _____
159     False True  True       4  False   True   True
160     True  False False      6   True  False  False
161     False False False      4  False  False  False
162     >>>
163     >>> # Using a dataset with missing data, we can use missingness as
164     >>> # an indicator:
165     >>> data = pd.DataFrame({"val1": [pd.NA, .7, pd.NA, .9],
166     ...                      "val2": ["male", pd.NA, "female", "female"],
167     ...                      "val3": [pd.NA, pd.NA, 23000, 78000]})
168     >>> from_indicators(pd.isna, data=data)
Differences (unified diff with -expected +actual):
    @@ -1,6 +1,6 @@
                        val1    val2   val3
    -val1  val2  val3
    +val1  val2  val3                      
     True  False True   <NA>    male   <NA>
    -False True  True    0.7    <NA>   <NA>
    +False True  True    0.7     NaN   <NA>
     True  False False  <NA>  female  23000
     False False False   0.9  female  78000

That is, there is extra whitespace in the header, and one of the <NA> is replaced by a NaN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions