Skip to content

Test doctests in pandas/core/reshape/concat.py #26436

@HyukjinKwon

Description

@HyukjinKwon

Code Sample, a copy-pastable example if possible

Problem description

Doctests in concat.py are being failed as below:

Failed example:
    pd.concat([df5, df6], verify_integrity=True)
Expected:
    Traceback (most recent call last):
        ...
    ValueError: Indexes have overlapping values: ['a']
Got:
    Traceback (most recent call last):
      File "/Applications/PyCharm.app/Contents/helpers/pycharm/docrunner.py", line 140, in __run
        compileflags, 1), test.globs)
      File "<doctest concat[21]>", line 1, in <module>
        pd.concat([df5, df6], verify_integrity=True)
      File "/usr/local/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 228, in concat
        copy=copy, sort=sort)
      File "/usr/local/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 381, in __init__
        self.new_axes = self._get_new_axes()
      File "/usr/local/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 461, in _get_new_axes
        new_axes[self.axis] = self._get_concat_axis()
      File "/usr/local/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 519, in _get_concat_axis
        self._maybe_check_integrity(concat_axis)
      File "/usr/local/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 528, in _maybe_check_integrity
        '{overlap!s}'.format(overlap=overlap))
    ValueError: Indexes have overlapping values: Index(['a'], dtype='object')

Expected Output

Doctests being passed.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.7.3.final.0
python-bits: 64
OS: Darwin
OS-release: 18.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.24.2
pytest: 4.4.1
pip: 19.0.3
setuptools: 40.8.0
Cython: None
numpy: 1.16.2
scipy: None
pyarrow: 0.13.0
xarray: None
IPython: None
sphinx: 2.0.1
patsy: None
dateutil: 2.8.0
pytz: 2019.1
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10.1
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions