Skip to content

CI: Doctests failing on master #42798

Closed
@datapythonista

Description

@datapythonista

The next doctests are failing on master, and are breaking the CI. Didn't check what caused the problem, would be good to understand (I guess we merged a PR that wasn't updated). In any case, we should update the output, so the CI is green again:

_______________ [doctest] pandas.core.construction.extract_array _______________
398     Categories (3, object): ['a', 'b', 'c']
399 
400     Other objects like lists, arrays, and DataFrames are just passed through.
401 
402     >>> extract_array([1, 2, 3])
403     [1, 2, 3]
404 
405     For an ndarray-backed Series / Index a PandasArray is returned.
406 
407     >>> extract_array(pd.Series([1, 2, 3]))
Expected:
    <PandasArray>
    [1, 2, 3]
    Length: 3, dtype: int64
Got:
    array([1, 2, 3])

/home/runner/work/pandas/pandas/pandas/core/construction.py:407: DocTestFailure
_______________ [doctest] pandas.core.indexing.IndexingMixin.loc _______________
356         Alignable boolean Series:
357 
358         >>> df.loc[pd.Series([False, True, False],
359         ...        index=['viper', 'sidewinder', 'cobra'])]
360                     max_speed  shield
361         sidewinder          7       8
362 
363         Index (same behavior as ``df.reindex``)
364 
365         >>> df.loc[pd.Index(["cobra", "viper"], name="foo")]
Differences (unified diff with -expected +actual):
    @@ -1,4 +1,3 @@
            max_speed  shield
    -foo
     cobra          1       2
     viper          4       5

/home/runner/work/pandas/pandas/pandas/core/indexing.py:365: DocTestFailure
__________________ [doctest] pandas.core.indexing._LocIndexer __________________
1043 Alignable boolean Series:
1044 
1045 >>> df.loc[pd.Series([False, True, False],
1046 ...        index=['viper', 'sidewinder', 'cobra'])]
1047             max_speed  shield
1048 sidewinder          7       8
1049 
1050 Index (same behavior as ``df.reindex``)
1051 
1052 >>> df.loc[pd.Index(["cobra", "viper"], name="foo")]
Differences (unified diff with -expected +actual):
    @@ -1,4 +1,3 @@
            max_speed  shield
    -foo
     cobra          1       2
     viper          4       5

/home/runner/work/pandas/pandas/pandas/core/indexing.py:1052: DocTestFailure

The next command should report the above errors, and should return clean after the fixes: ./ci/code_checks.sh doctests

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous IntegrationDocsTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions