Skip to content

Commit 3e71284

Browse files
author
Marco Gorelli
committed
🔀 fix conflicts, fix nameerror in tests
1 parent 5c85eca commit 3e71284

File tree

3 files changed

+4
-36
lines changed

3 files changed

+4
-36
lines changed

doc/source/whatsnew/v1.0.0.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,13 +1245,9 @@ Reshaping
12451245
- Bug in :func:`melt` where supplying mixed strings and numeric values for ``id_vars`` or ``value_vars`` would incorrectly raise a ``ValueError`` (:issue:`29718`)
12461246
- Dtypes are now preserved when transposing a ``DataFrame`` where each column is the same extension dtype (:issue:`30091`)
12471247
- Bug in :func:`merge_asof` merging on a tz-aware ``left_index`` and ``right_on`` a tz-aware column (:issue:`29864`)
1248-
<<<<<<< HEAD
12491248
- Improved error message and docstring in :func:`cut` and :func:`qcut` when `labels=True` (:issue:`13318`)
12501249
- Bug in missing `fill_na` parameter to :meth:`DataFrame.unstack` with list of levels (:issue:`30740`)
12511250
- :meth:`DataFrame.merge` now preserves right frame's row order when executing a right merge (:issue:`27453`)
1252-
=======
1253-
>>>>>>> 2b1b67592... changes requested by jreback
1254-
-
12551251

12561252
Sparse
12571253
^^^^^^

pandas/core/reshape/merge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,10 @@ def __init__(
568568
indicator: bool = False,
569569
validate=None,
570570
):
571-
left = validate_operand(left)
572-
right = validate_operand(right)
573-
self.left = self.orig_left = left
574-
self.right = self.orig_right = right
571+
_left = _validate_operand(left)
572+
_right = _validate_operand(right)
573+
self.left = self.orig_left = _left
574+
self.right = self.orig_right = _right
575575
self.how = how
576576
self.axis = axis
577577

pandas/tests/reshape/merge/test_merge.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,34 +2194,6 @@ def test_merge_preserves_row_order(how):
21942194
expected_cols = ["name", "country", "population"]
21952195
expected = DataFrame(expected_data, columns=expected_cols)
21962196

2197-
result = pop.merge(ppl, on=("name", "country"), how="right")
2198-
2199-
tm.assert_frame_equal(result, expected)
2200-
2201-
2202-
def test_left_merge_preserves_row_order():
2203-
# GH 27453
2204-
population = [
2205-
("Jenn", "Jamaica", 3),
2206-
("Beth", "Bulgaria", 7),
2207-
("Carl", "Canada", 30),
2208-
]
2209-
columns = ["name", "country", "population"]
2210-
pop = DataFrame(population, columns=columns)
2211-
2212-
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
2213-
columns = ["name", "country"]
2214-
ppl = DataFrame(people, columns=columns)
2215-
2216-
expected_data = [
2217-
("Abe", "America", np.nan),
2218-
("Beth", "Bulgaria", 7),
2219-
("Carl", "Canada", 30),
2220-
]
2221-
expected_cols = ["name", "country", "population"]
2222-
expected = DataFrame(expected_data, columns=expected_cols)
2223-
2224-
result = ppl.merge(pop, on=("name", "country"), how="left")
22252197
if how == "right":
22262198
left_df, right_df = population_df, people_df
22272199
elif how == "left":

0 commit comments

Comments
 (0)