Skip to content

Commit 11492ed

Browse files
authored
Revert "REGR: concat(ints, bools) casting to object pandas-dev#42092 (pandas-dev#42541)"
This reverts commit 80a72c1.
1 parent 7b0a8f1 commit 11492ed

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

doc/source/whatsnew/v1.3.1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Fixed regressions
2323
- Performance regression in :meth:`DataFrame.to_dict` and :meth:`Series.to_dict` when ``orient`` argument one of "records", "dict", or "split" (:issue:`42352`)
2424
- Fixed regression in indexing with a ``list`` subclass incorrectly raising ``TypeError`` (:issue:`42433`, :issue:`42461`)
2525
- Fixed regression in :meth:`DataFrame.isin` and :meth:`Series.isin` raising ``TypeError`` with nullable data containing at least one missing value (:issue:`42405`)
26-
- Regression in :func:`concat` between objects with bool dtype and integer dtype casting to object instead of to integer (:issue:`42092`)
26+
-
2727

2828
.. ---------------------------------------------------------------------------
2929

pandas/core/internals/concat.py

-3
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,6 @@ def _is_uniform_join_units(join_units: list[JoinUnit]) -> bool:
592592
# e.g. DatetimeLikeBlock can be dt64 or td64, but these are not uniform
593593
all(
594594
is_dtype_equal(ju.block.dtype, join_units[0].block.dtype)
595-
# GH#42092 we only want the dtype_equal check for non-numeric blocks
596-
# (for now, may change but that would need a deprecation)
597-
or ju.block.dtype.kind in ["b", "i", "u"]
598595
for ju in join_units
599596
)
600597
and

pandas/tests/reshape/concat/test_dataframe.py

-10
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,3 @@ def test_concat_dataframe_keys_bug(self, sort):
170170
# it works
171171
result = concat([t1, t2], axis=1, keys=["t1", "t2"], sort=sort)
172172
assert list(result.columns) == [("t1", "value"), ("t2", "value")]
173-
174-
def test_concat_bool_with_int(self):
175-
# GH#42092 we may want to change this to return object, but that
176-
# would need a deprecation
177-
df1 = DataFrame(Series([True, False, True, True], dtype="bool"))
178-
df2 = DataFrame(Series([1, 0, 1], dtype="int64"))
179-
180-
result = concat([df1, df2])
181-
expected = concat([df1.astype("int64"), df2])
182-
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)