Skip to content

Commit fc8ac2c

Browse files
committed
update whatsnew and tests
1 parent d86c1fb commit fc8ac2c

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

doc/source/whatsnew/v0.22.0.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ Other Enhancements
4444
- :class:`pandas.io.formats.style.Styler` now has method ``hide_columns()`` to determine whether columns will be hidden in output (:issue:`14194`)
4545
- Improved wording of ``ValueError`` raised in :func:`to_datetime` when ``unit=`` is passed with a non-convertible value (:issue:`14350`)
4646
- :func:`Series.fillna` now accepts a Series or a dict as a ``value`` for a categorical dtype (:issue:`17033`)
47-
- :func:`pandas.DataFrame.merge` no longer casts a ``float`` column to ``object`` when merging on ``int`` and ``float`` columns (:issue:`16572`)
4847

4948
.. _whatsnew_0220.api_breaking:
5049

5150
Backwards incompatible API changes
5251
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5352

5453
- :func:`Series.fillna` now raises a ``TypeError`` instead of a ``ValueError`` when passed a list, tuple or DataFrame as a ``value`` (:issue:`18293`)
55-
-
54+
- :func:`pandas.DataFrame.merge` no longer casts a ``float`` column to ``object`` when merging on ``int`` and ``float`` columns (:issue:`16572`)
5655
-
5756

5857

pandas/tests/reshape/test_merge.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1422,13 +1422,13 @@ def test_merge_on_ints_floats(self, int_vals, float_vals, exp_vals):
14221422
# merging on float and int columns
14231423
A = DataFrame({'X': int_vals})
14241424
B = DataFrame({'Y': float_vals})
1425-
exp_res = DataFrame(exp_vals)
1425+
expected = DataFrame(exp_vals)
14261426

1427-
res = A.merge(B, left_on='X', right_on='Y')
1428-
assert_frame_equal(res, exp_res)
1427+
result = A.merge(B, left_on='X', right_on='Y')
1428+
assert_frame_equal(result, expected)
14291429

1430-
res = B.merge(A, left_on='Y', right_on='X')
1431-
assert_frame_equal(res, exp_res[['Y', 'X']])
1430+
result = B.merge(A, left_on='Y', right_on='X')
1431+
assert_frame_equal(result, expected[['Y', 'X']])
14321432

14331433
def test_merge_on_ints_floats_warning(self):
14341434
# GH 16572
@@ -1437,15 +1437,15 @@ def test_merge_on_ints_floats_warning(self):
14371437
# equal to their int representation
14381438
A = DataFrame({'X': [1, 2, 3]})
14391439
B = DataFrame({'Y': [1.1, 2.5, 3.0]})
1440-
exp_res = DataFrame({'X': [3], 'Y': [3.0]})
1440+
expected = DataFrame({'X': [3], 'Y': [3.0]})
14411441

14421442
with tm.assert_produces_warning(UserWarning):
1443-
res = A.merge(B, left_on='X', right_on='Y')
1444-
assert_frame_equal(res, exp_res)
1443+
result = A.merge(B, left_on='X', right_on='Y')
1444+
assert_frame_equal(result, expected)
14451445

14461446
with tm.assert_produces_warning(UserWarning):
1447-
res = B.merge(A, left_on='Y', right_on='X')
1448-
assert_frame_equal(res, exp_res[['Y', 'X']])
1447+
result = B.merge(A, left_on='Y', right_on='X')
1448+
assert_frame_equal(result, expected[['Y', 'X']])
14491449

14501450

14511451
@pytest.fixture

0 commit comments

Comments
 (0)