Skip to content
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pandas/tests/frame/methods/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import numpy as np
import pytest

from pandas.errors import InvalidIndexError

import pandas as pd
from pandas import (
DataFrame,
Expand Down Expand Up @@ -369,3 +371,11 @@ def test_frame_join_tzaware(self):

tm.assert_index_equal(result.index, expected)
assert result.index.tz.zone == "US/Central"

def test_duplicate_indices_concat_raise(self):
# https://github.com/pandas-dev/pandas/issues/36263
df1 = DataFrame(np.random.randn(5), index=[0, 1, 2, 3, 3], columns=["a"])
df2 = DataFrame(np.random.randn(5), index=[0, 1, 2, 2, 4], columns=["b"])
msg = "Reindexing only valid with uniquely valued Index objects"
with pytest.raises(InvalidIndexError, match=msg):
pd.concat([df1, df2], axis=1)