Skip to content

Commit a53cc22

Browse files
author
Marco Gorelli
committed
📝 add whatsnew entry to v1.0.1
1 parent 25f7e03 commit a53cc22

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

doc/source/whatsnew/v1.0.0.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,6 @@ Reshaping
12461246
- Bug in :func:`merge_asof` merging on a tz-aware ``left_index`` and ``right_on`` a tz-aware column (:issue:`29864`)
12471247
- Improved error message and docstring in :func:`cut` and :func:`qcut` when `labels=True` (:issue:`13318`)
12481248
- Bug in missing `fill_na` parameter to :meth:`DataFrame.unstack` with list of levels (:issue:`30740`)
1249-
- :meth:`DataFrame.merge` now preserves right frame's row order when executing a right merge (:issue:`27453`)
12501249

12511250
Sparse
12521251
^^^^^^

pandas/tests/reshape/merge/test_merge.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,25 +2172,25 @@ def test_merge_datetime_upcast_dtype():
21722172
@pytest.mark.parametrize("how", ["left", "right"])
21732173
def test_merge_preserves_row_order(how):
21742174
# GH 27453
2175-
population = [
2176-
("Jenn", "Jamaica", 3),
2177-
("Beth", "Bulgaria", 7),
2178-
("Carl", "Canada", 30),
2179-
]
2180-
columns = ["name", "country", "population"]
2181-
population_df = DataFrame(population, columns=columns)
2175+
population_df = DataFrame(
2176+
{
2177+
"name": ["Jenn", "Beth", "Carl"],
2178+
"country": ["Jamaica", "Bulgaria", "Canada"],
2179+
"population": [3, 7, 30],
2180+
}
2181+
)
21822182

2183-
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
2184-
columns = ["name", "country"]
2185-
people_df = DataFrame(people, columns=columns)
2183+
people_df = DataFrame(
2184+
{"name": ["Abe", "Beth", "Carl"], "country": ["America", "Bulgaria", "Canada"]}
2185+
)
21862186

2187-
expected_data = [
2188-
("Abe", "America", np.nan),
2189-
("Beth", "Bulgaria", 7),
2190-
("Carl", "Canada", 30),
2191-
]
2192-
expected_cols = ["name", "country", "population"]
2193-
expected = DataFrame(expected_data, columns=expected_cols)
2187+
expected = DataFrame(
2188+
{
2189+
"name": ["Abe", "Beth", "Carl"],
2190+
"country": ["America", "Bulgaria", "Canada"],
2191+
"population": [np.nan, 7, 30],
2192+
}
2193+
)
21942194

21952195
if how == "right":
21962196
left_df, right_df = population_df, people_df

0 commit comments

Comments
 (0)